Esempio n. 1
0
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientProgram program = new WfClientProgram();

            program.ApplicationCodeName = dictionary.GetValue("applicationCodeName", string.Empty);
            program.CodeName            = dictionary.GetValue("codeName", string.Empty);
            program.Name = dictionary.GetValue("name", string.Empty);
            program.Sort = dictionary.GetValue("sort", 0);

            return(program);
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientProgram program = new WfClientProgram();

            program.ApplicationCodeName = dictionary.GetValue("applicationCodeName", string.Empty);
            program.CodeName = dictionary.GetValue("codeName", string.Empty);
            program.Name = dictionary.GetValue("name", string.Empty);
            program.Sort = dictionary.GetValue("sort", 0);

            return program;
        }
Esempio n. 3
0
        public override IDictionary <string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            WfClientProgram program = (WfClientProgram)obj;

            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.AddNonDefaultValue("applicationCodeName", program.ApplicationCodeName);
            dictionary.AddNonDefaultValue("codeName", program.CodeName);
            dictionary.AddNonDefaultValue("name", program.Name);
            dictionary.AddNonDefaultValue("sort", program.Sort);

            return(dictionary);
        }
        public WfClientProgram ServerToClient(WfProgram server, ref WfClientProgram client)
        {
            server.NullCheck("server");

            if (client == null)
            {
                client = new WfClientProgram();
            }

            client.ApplicationCodeName = server.ApplicationCodeName;
            client.CodeName            = server.CodeName;
            client.Name = server.Name;
            client.Sort = server.Sort;

            return(client);
        }
        public WfClientProgramInApplicationCollection ServerToClient(WfProgramInApplicationCollection server)
        {
            server.NullCheck("server");

            WfClientProgramInApplicationCollection client = new WfClientProgramInApplicationCollection();

            foreach (WfProgram serverItem in server)
            {
                WfClientProgram clientItem = null;

                this.ServerToClient(serverItem, ref clientItem);

                client.Add(clientItem);
            }

            return(client);
        }