public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { WfClientRelativeLinkDescriptor relativeLink = (WfClientRelativeLinkDescriptor)base.Deserialize(dictionary, type, serializer); relativeLink.Category = dictionary.GetValue("category", string.Empty); relativeLink.Url = dictionary.GetValue("url", string.Empty); return(relativeLink); }
public override IDictionary <string, object> Serialize(object obj, JavaScriptSerializer serializer) { WfClientRelativeLinkDescriptor relativeLink = (WfClientRelativeLinkDescriptor)obj; IDictionary <string, object> dictionary = base.Serialize(obj, serializer); dictionary.AddNonDefaultValue("category", relativeLink.Category); dictionary.AddNonDefaultValue("url", relativeLink.Url); return(dictionary); }
public void ServerToClient(IEnumerable <IWfRelativeLinkDescriptor> server, ICollection <WfClientRelativeLinkDescriptor> client) { server.NullCheck("server"); foreach (WfRelativeLinkDescriptor st in server) { WfClientRelativeLinkDescriptor ct = null; WfClientRelativeLinkDescriptorConverter.Instance.ServerToClient(st, ref ct); client.Add(ct); } }