PropertySegmentSerializationProvider.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Serializer / PropertySegmentSerializationProvider.cs / 1305376 / PropertySegmentSerializationProvider.cs

                            namespace System.Workflow.ComponentModel.Serialization 
{
    using System;
    using System.Reflection;
    using System.Xml; 
    using System.ComponentModel.Design.Serialization;
    using System.Collections; 
    using System.Workflow.ComponentModel.Design; 
    using System.ComponentModel;
 
    #region Class PropertySegmentSerializationProvider
    internal sealed class PropertySegmentSerializationProvider : WorkflowMarkupSerializationProvider
    {
        #region IDesignerSerializationProvider Members 
        public override object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType)
        { 
            if (serializerType.IsAssignableFrom(typeof(WorkflowMarkupSerializer))) 
            {
                if (currentSerializer is PropertySegmentSerializer) 
                    return currentSerializer;
                else if (objectType == typeof(PropertySegment))
                    return new PropertySegmentSerializer(null);
                else if (currentSerializer is WorkflowMarkupSerializer) 
                    return new PropertySegmentSerializer(currentSerializer as WorkflowMarkupSerializer);
                else 
                    return null; 
            }
            else 
            {
                return base.GetSerializer(manager, currentSerializer, objectType, serializerType);
            }
        } 
        #endregion
    } 
    #endregion 

} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
namespace System.Workflow.ComponentModel.Serialization 
{
    using System;
    using System.Reflection;
    using System.Xml; 
    using System.ComponentModel.Design.Serialization;
    using System.Collections; 
    using System.Workflow.ComponentModel.Design; 
    using System.ComponentModel;
 
    #region Class PropertySegmentSerializationProvider
    internal sealed class PropertySegmentSerializationProvider : WorkflowMarkupSerializationProvider
    {
        #region IDesignerSerializationProvider Members 
        public override object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType)
        { 
            if (serializerType.IsAssignableFrom(typeof(WorkflowMarkupSerializer))) 
            {
                if (currentSerializer is PropertySegmentSerializer) 
                    return currentSerializer;
                else if (objectType == typeof(PropertySegment))
                    return new PropertySegmentSerializer(null);
                else if (currentSerializer is WorkflowMarkupSerializer) 
                    return new PropertySegmentSerializer(currentSerializer as WorkflowMarkupSerializer);
                else 
                    return null; 
            }
            else 
            {
                return base.GetSerializer(manager, currentSerializer, objectType, serializerType);
            }
        } 
        #endregion
    } 
    #endregion 

} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK