Exemple #1
0
        private PropertySetting ReadPropertySettingCore(
            Theme theme,
            XmlTextReader reader)
        {
            string          fullName        = "";
            string          str1            = "";
            string          str2            = "";
            PropertySetting propertySetting = new PropertySetting();

            while (reader.MoveToNextAttribute())
            {
                if (reader.Name == "Property")
                {
                    fullName = reader.Value;
                }
                else if (reader.Name == "Value")
                {
                    str1 = reader.Value;
                }
                else if (reader.Name == "EndValue")
                {
                    str2 = reader.Value;
                }
            }
            if (!string.IsNullOrEmpty(fullName))
            {
                try
                {
                    string[] strArray     = fullName.Split('.');
                    string   propertyName = "";
                    if (strArray.Length > 1)
                    {
                        propertyName = strArray[strArray.Length - 1];
                        string.Join(".", strArray, 0, strArray.Length - 1);
                    }
                    if (this.storeFullPropertyName)
                    {
                        propertySetting.FullName = fullName;
                    }
                    else
                    {
                        propertySetting.Name = propertyName;
                    }
                    if (!string.IsNullOrEmpty(str1))
                    {
                        propertySetting.Value = PropertyReader.Deserialize(fullName, propertyName, str1);
                    }
                    if (!string.IsNullOrEmpty(str2))
                    {
                        propertySetting.EndValue = PropertyReader.Deserialize(fullName, propertyName, str2);
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(propertySetting);
        }
Exemple #2
0
        protected virtual PropertySetting CreatePropertySetting(CSSItem item)
        {
            if (item.childItems.Count <= 0)
            {
                return(new PropertySetting(item.name, PropertyReader.Deserialize(item.name, item.value)));
            }
            PropertySetting propertySetting = new PropertySetting(item.name, (object)null)
            {
                Value           = PropertyReader.Deserialize(item.name, item["Value"]),
                EndValue        = PropertyReader.Deserialize(item.name, item["EndValue"]),
                AnimatedSetting = new AnimatedPropertySetting()
            };

            propertySetting.AnimatedSetting.StartValue     = propertySetting.Value;
            propertySetting.AnimatedSetting.EndValue       = propertySetting.EndValue;
            propertySetting.AnimatedSetting.IsStyleSetting = true;
            if (item["MaxValue"] != null)
            {
                propertySetting.AnimatedSetting.MaxValue = PropertyReader.Deserialize(item.name, item["MaxValue"]);
            }
            string str1 = item["EasingType"];

            if (!string.IsNullOrEmpty(str1))
            {
                propertySetting.AnimatedSetting.ApplyEasingType = (RadEasingType)Enum.Parse(typeof(RadEasingType), str1);
            }
            string s1 = item["Interval"];

            if (!string.IsNullOrEmpty(s1))
            {
                propertySetting.AnimatedSetting.Interval = int.Parse(s1);
            }
            string s2 = item["Frames"];

            if (!string.IsNullOrEmpty(s2))
            {
                propertySetting.AnimatedSetting.NumFrames = int.Parse(s2);
            }
            string s3 = item["ApplyDelay"];

            if (!string.IsNullOrEmpty(s3))
            {
                propertySetting.AnimatedSetting.ApplyDelay = int.Parse(s3);
            }
            string s4 = item["RandomDelay"];

            if (!string.IsNullOrEmpty(s4))
            {
                propertySetting.AnimatedSetting.RandomDelay = int.Parse(s4);
            }
            string str2 = item["RemoveAfterApply"];

            if (!string.IsNullOrEmpty(str2))
            {
                propertySetting.AnimatedSetting.RemoveAfterApply = bool.Parse(str2);
            }
            return(propertySetting);
        }
Exemple #3
0
 public static object Deserialize(string propertyName, string value)
 {
     return(PropertyReader.Deserialize((string)null, propertyName, value));
 }