public virtual object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType)
 {
     if ((serializerType != typeof(WorkflowMarkupSerializer)) || (currentSerializer != null))
     {
         return(null);
     }
     if (typeof(IDictionary).IsAssignableFrom(objectType))
     {
         return(new DictionaryMarkupSerializer());
     }
     if (CollectionMarkupSerializer.IsValidCollectionType(objectType))
     {
         return(new CollectionMarkupSerializer());
     }
     return(new WorkflowMarkupSerializer());
 }
Ejemplo n.º 2
0
        public virtual object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType)
        {
            // If this isn't a serializer type we recognize, do nothing.  Also, if metadata specified
            // a custom serializer, then use it.
            if (serializerType != typeof(WorkflowMarkupSerializer) || currentSerializer != null)
            {
                return(null);
            }

            //DO NOT CHANGE THIS ORDER ELSE DICTIONARY WILL START GETTING SERIALIZED AS COLLECTION
            if (typeof(IDictionary).IsAssignableFrom(objectType))
            {
                return(new DictionaryMarkupSerializer());
            }

            if (CollectionMarkupSerializer.IsValidCollectionType(objectType))
            {
                return(new CollectionMarkupSerializer());
            }

            return(new WorkflowMarkupSerializer());
        }