Пример #1
0
 public ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)
 {
     if (SPSerializer.IsSpeciallySerialized(type))
     {
         selector = this;
         return(this);
     }
     else if (_nextSelector != null)
     {
         return(_nextSelector.GetSurrogate(type, context, out selector));
     }
     else
     {
         selector = null;
         return(null);
     }
 }
Пример #2
0
        public override ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)
        {
            ISerializationSurrogate surrogate = null;

            selector = null;
            if (_formattersSurrogateSelector != null)
            {
                surrogate = _formattersSurrogateSelector.GetSurrogate(type, context, out selector);
            }
            if (surrogate == null)
            {
                surrogate = base.GetSurrogate(type, context, out selector);
            }
            if (surrogate == null && SPSerializer.IsSpeciallySerialized(type))
            {
                selector  = this;
                surrogate = _specialSurrogate;
            }

            return(surrogate);
        }