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); } }
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); }
public Serializer() { bf = new JsonFormatter(); serializer = new SPSerializer(); serializer.AssetBundle = ResourcesAssetBundle.Instance; }