Ejemplo n.º 1
0
        public override void GetSetting()
        {
            base.GetSetting();

            this.generalAnimationSettings1.GetValues();
            this.AnimatedSetting.StartValueIsCurrentValue = (this.checkBoxUseCurrentValue.Checked);

            if (!this.checkBoxUseCurrentValue.Checked)
            {
                this.AnimatedSetting.Value = XmlPropertySetting.DeserializeValue(this.Property, this.tbStartRectangle.Text);
            }
            else
            {
                this.AnimatedSetting.Value = null;
            }

            this.AnimatedSetting.StartValueIsCurrentValue = this.checkBoxUseCurrentValue.Checked;
            //   this.AnimatedSetting.ApplyEasingType = this.comboApplyeasing

            if (this.AnimatedSetting.AnimationType == RadAnimationType.ByStartEndValues)
            {
                this.AnimatedSetting.EndValue = XmlPropertySetting.DeserializeValue(Property, this.tbEndRectangle.Text);
            }
            else
            {
                this.AnimatedSetting.Step = XmlAnimatedPropertySetting.SerializeStep(this.GetValidatedPadding(tbStepRectangle.Text));

                if (!checkBoxAutomaticReverse.Checked)
                {
                    this.AnimatedSetting.ReverseStep =
                        XmlAnimatedPropertySetting.SerializeStep(this.GetValidatedPadding(tbReversedStepRectangle.Text));
                }
            }
        }
Ejemplo n.º 2
0
        public static object Deserialize(string fullName, string propertyName, string value)
        {
            if (PropertyReader.directConverters.ContainsKey(propertyName))
            {
                return(PropertyReader.directConverters[propertyName](value));
            }
            if (PropertyReader.typeDescriptorConverters.ContainsKey(propertyName))
            {
                return(PropertyReader.typeDescriptorConverters[propertyName].Converter?.ConvertFromString((ITypeDescriptorContext)null, PropertyReader.serializationCulture, value));
            }
            object obj = (object)null;

            try
            {
                RadProperty property = XmlPropertySetting.DeserializePropertySafe(!string.IsNullOrEmpty(fullName) ? fullName : propertyName);
                if (property != null)
                {
                    obj = XmlPropertySetting.DeserializeValue(property, value);
                }
            }
            catch
            {
            }
            return(obj);
        }
Ejemplo n.º 3
0
        private void SizeAnimationForm_Load(object sender, EventArgs e)
        {
            Decimal minValue      = Decimal.MinValue;
            Decimal maxValue      = Decimal.MaxValue;
            int     decimalPlaces = 0;

            if (Property.PropertyType == typeof(float))
            {
                decimalPlaces = 2;
            }
            else if (Property.PropertyType == typeof(double))
            {
                decimalPlaces = 3;
            }

            this.numericUpDownStart1.Minimum            = minValue;
            this.numericUpDownStart1.Maximum            = maxValue;
            this.numericUpDownStart1.DecimalPlaces      = decimalPlaces;
            this.numericUpDownEnd1.Minimum              = minValue;
            this.numericUpDownEnd1.Maximum              = maxValue;
            this.numericUpDownEnd1.DecimalPlaces        = decimalPlaces;
            this.numericUpDownStep.Minimum              = minValue;
            this.numericUpDownStep.Maximum              = maxValue;
            this.numericUpDownStep.DecimalPlaces        = decimalPlaces;
            this.numericUpDownReverseStep.Minimum       = minValue;
            this.numericUpDownReverseStep.Maximum       = maxValue;
            this.numericUpDownReverseStep.DecimalPlaces = decimalPlaces;

            if (AnimatedSetting.Value != null)
            {
                if (Property.PropertyType == typeof(Size))
                {
                    Size size = (Size)AnimatedSetting.Value;
                    this.numericUpDownStart1.Value = Convert.ToDecimal(size.Width);
                    this.numericUpDownEnd1.Value   = Convert.ToDecimal(size.Height);
                }

                if (this.numericUpDownStart1.Value == 0)
                {
                    this.checkBoxUseCurrentValue.Checked = true;
                }
            }
            if (AnimatedSetting.EndValue != null)
            {
                Size size = (Size)AnimatedSetting.EndValue;

                this.numericUpDownStart2.Value = Convert.ToDecimal(size.Width);
                this.numericUpDownEnd2.Value   = Convert.ToDecimal(size.Height);
            }

            if (AnimatedSetting.Step != null)
            {
                this.numericUpDownStep.Value = Convert.ToDecimal(XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.Step.Value));
            }
            if (AnimatedSetting.ReverseStep != null)
            {
                this.numericUpDownReverseStep.Value = Convert.ToDecimal(XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.ReverseStep.Value));
            }
            else
            {
                this.checkBoxAutomaticReverse.Checked = true;
                this.numericUpDownReverseStep.Enabled = false;
            }
        }
Ejemplo n.º 4
0
        public static object DeserializeValue(RadProperty property, string value, bool throwOnError)
        {
            if (value == null)
            {
                return((object)null);
            }
            PropertyDescriptor prop = TypeDescriptor.GetProperties(property.OwnerType).Find(property.Name, true);

            return(prop == null?XmlPropertySetting.ConvertValueFromString(TypeDescriptor.GetConverter(property.PropertyType), value, property.FullName, property.PropertyType, throwOnError) : XmlPropertySetting.DeserializeValue(prop, value, property.FullName, throwOnError));
        }
Ejemplo n.º 5
0
 public static object DeserializeValue(RadProperty property, string value)
 {
     return(XmlPropertySetting.DeserializeValue(property, value, false));
 }