示例#1
0
        protected internal override bool ApplySerializedData(Dictionary <string, object> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            if (base.ApplySerializedData(data))
            {
                // Check if all keys are present
                if (DeserializationNeededKeys.Any(key => !data.ContainsKey(key)))
                {
                    return(false);
                }

                // Apply all keys to the object instance
                //DisplayName = (string) data["DisplayName"];
                //DefaultValue = (bool) data["DefaultValue"];
                //BindType = (BindTypes) Convert.ToInt64(data["BindType"]);
                CurrentValue = (bool)data["CurrentValue"];
                Keys         = new Tuple <uint, uint>(Convert.ToUInt32(data["Key1"]), Convert.ToUInt32(data["Key2"]));

                return(true);
            }
            return(false);
        }
示例#2
0
        protected internal override bool ApplySerializedData(Dictionary <string, object> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            if (base.ApplySerializedData(data))
            {
                // Check if all keys are present
                if (DeserializationNeededKeys.Any(key => !data.ContainsKey(key)))
                {
                    return(false);
                }

                // Apply all keys to the object instance
                //DisplayName = (string) data["DisplayName"];
                //MinValue = Convert.ToInt32(data["MinValue"]);
                //MaxValue = Convert.ToInt32(data["MaxValue"]);
                CurrentValue = Convert.ToInt32(data["CurrentValue"]);

                return(true);
            }
            return(false);
        }