예제 #1
0
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (type != typeof(PostBackHash) && type != typeof(List <PostBackHash>))
            {
                return(null);
            }

            PostBackHash hash = new PostBackHash();

            if (dictionary.ContainsKey("id"))
            {
                hash.ControlID = serializer.ConvertToType <String>(dictionary["id"]);
            }

            if (dictionary.ContainsKey("widgetName"))
            {
                hash.WidgetName = serializer.ConvertToType <String>(dictionary["widgetName"]);
            }

            if (dictionary.ContainsKey("options"))
            {
                hash.Options = serializer.ConvertToType <Dictionary <String, object> >(dictionary["options"]);
            }

            return(hash);
        }
예제 #2
0
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if(type != typeof(PostBackHash) && type != typeof(List<PostBackHash>)) {
                return null;
            }

            PostBackHash hash = new PostBackHash();

            if(dictionary.ContainsKey("id")) {
                hash.ControlID = serializer.ConvertToType<String>(dictionary["id"]);
            }

            if(dictionary.ContainsKey("widgetName")) {
                hash.WidgetName = serializer.ConvertToType<String>(dictionary["widgetName"]);
            }

            if(dictionary.ContainsKey("options")) {
                hash.Options = serializer.ConvertToType<Dictionary<String, object>>(dictionary["options"]);
            }

            return hash;
        }