Пример #1
0
        protected override XmlPropertySetting Serialize()
        {
            XmlAnimatedPropertySetting xmlPropertySetting = new XmlAnimatedPropertySetting();

            xmlPropertySetting.AnimationLoopType = this.AnimationLoopType;
            xmlPropertySetting.Property          = this.Property.FullName;
            xmlPropertySetting.Value             = this.StartValue; //XmlPropertySetting.SerializeValue(this.Property, this.StartValue);
            xmlPropertySetting.EndValue          = this.EndValue;   //XmlPropertySetting.SerializeValue(this.Property, this.EndValue);

            xmlPropertySetting.Step = null;
            if (this.Step != null)
            {
                xmlPropertySetting.Step = new XmlAnimationStep(this.Step);
            }

            if (this.ReverseStep != null)
            {
                xmlPropertySetting.ReverseStep = new XmlAnimationStep(this.ReverseStep);
            }

            xmlPropertySetting.ApplyEasingType          = this.ApplyEasingType;
            xmlPropertySetting.UnapplyEasingType        = this.UnapplyEasingType;
            xmlPropertySetting.Interval                 = this.Interval;
            xmlPropertySetting.NumFrames                = this.NumFrames;
            xmlPropertySetting.AnimationType            = this.AnimationType;
            xmlPropertySetting.StartValueIsCurrentValue = this.StartValueIsCurrentValue;

            return(xmlPropertySetting);
        }
Пример #2
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));
                }
            }
        }
Пример #3
0
        public override void GetSetting()
        {
            base.GetSetting();

            this.generalAnimationSettings1.GetValues();

            this.AnimatedSetting.Property = AnimatedSetting.Property;
            this.AnimatedSetting.StartValueIsCurrentValue = (this.checkBoxUseCurrentValue.Checked);

            if (this.checkBoxUseCurrentValue.Checked)
            {
                this.AnimatedSetting.Value = null;
            }
            else
            {
                this.AnimatedSetting.Value = new Size((int)this.numericUpDownStart1.Value, (int)this.numericUpDownEnd1.Value);
            }


            if (this.AnimatedSetting.AnimationType == RadAnimationType.ByStartEndValues)
            {
                this.AnimatedSetting.EndValue = new Size((int)this.numericUpDownStart2.Value, (int)this.numericUpDownEnd2.Value);
            }
            else
            {
                this.AnimatedSetting.Step = XmlAnimatedPropertySetting.SerializeStep(this.ConvertFromDecimal(this.numericUpDownStep.Value));
                if (!this.checkBoxAutomaticReverse.Checked)
                {
                    this.AnimatedSetting.ReverseStep = XmlAnimatedPropertySetting.SerializeStep(this.ConvertFromDecimal(this.numericUpDownReverseStep.Value));
                }
            }
        }
Пример #4
0
        public override void GetSetting()
        {
            base.GetSetting();

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

            if (!this.checkBoxUseCurrentValue.Checked)
            {
                this.AnimatedSetting.Value = this.GetFont(this.tbStartSize.Text);
            }
            else
            {
                this.AnimatedSetting.Value = null;
            }

            if (this.AnimatedSetting.AnimationType == RadAnimationType.ByStartEndValues)
            {
                this.AnimatedSetting.EndValue = this.GetFont(this.tbEndSize.Text);
            }
            else
            {
                this.AnimatedSetting.Step = XmlAnimatedPropertySetting.SerializeStep(
                    new FontAnimationStep(this.GetFont(this.tbStepSize.Text).Size)
                    );

                if (!checkBoxAutomaticReverse.Checked)
                {
                    this.AnimatedSetting.ReverseStep = XmlAnimatedPropertySetting.SerializeStep(
                        new FontAnimationStep(this.GetFont(this.tbReversedStepSize.Text).Size)
                        );
                }
            }
        }
Пример #5
0
        private void GeneralAnimationSettings_Load(object sender, EventArgs e)
        {
            XmlAnimatedPropertySetting setting = (Parent as AnimationForm).AnimatedSetting;

            if (setting != null)
            {
                this.comboBoxAnimationStyle.DataSource    = Enum.GetValues(typeof(AnimatorStyles));
                this.comboBoxAnimationStyle.SelectedIndex = (int)setting.AnimatorStyle;
                this.comboBoxApplyET.DataSource           = Enum.GetValues(typeof(RadEasingType));
                this.comboBoxUnApplyET.DataSource         = Enum.GetValues(typeof(RadEasingType));
                this.comboBoxApplyET.SelectedIndex        = (int)setting.ApplyEasingType;
                this.comboBoxUnApplyET.SelectedIndex      = (int)setting.UnapplyEasingType;
                if (setting.Interval == 0)
                {
                    setting.Interval = 1;
                }
                this.numericUpDownInterval.Value = 1000 / setting.Interval;
                this.numericUpDownFrames.Value   = setting.Interval * setting.NumFrames;
                if (setting.NumFrames == -1)
                {
                    this.checkBoxInfinitePositions.Checked = true;
                    this.numericUpDownFrames.Enabled       = false;
                }

                this.AnimationType = setting.AnimationType;
            }
        }
Пример #6
0
        private void ColorAnimationForm_Load(object sender, EventArgs e)
        {
            if (AnimatedSetting.Step != null)
            {
                //TODO: What if the step is different type?
                ColorAnimationStep step = (ColorAnimationStep)XmlAnimatedPropertySetting.DeserializeStep(AnimatedSetting.Step);

                this.upDownStepA.Value = step.A;
                this.upDownStepR.Value = step.R;
                this.upDownStepG.Value = step.G;
                this.upDownStepB.Value = step.B;
            }
            else
            {
                this.checkBoxUseCurrentValue.Checked = true;
            }

            if (AnimatedSetting.ReverseStep != null)
            {
                //TODO: What if the step is different type?
                ColorAnimationStep step = (ColorAnimationStep)XmlAnimatedPropertySetting.DeserializeStep(AnimatedSetting.ReverseStep);

                this.upDownReverseStepA.Value = step.A;
                this.upDownReverseStepR.Value = step.R;
                this.upDownReverseStepG.Value = step.G;
                this.upDownReverseStepB.Value = step.B;
            }

            if (AnimatedSetting.Value != null)
            {
                this.colorComboStart.SelectedColor   = (Color)AnimatedSetting.Value;//(Color)XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.Value);
                this.checkBoxUseCurrentValue.Checked = false;
            }
            else
            {
                this.checkBoxUseCurrentValue.Checked = true;
            }


            if (AnimatedSetting.EndValue != null)
            {
                this.colorComboEnd.SelectedColor = (Color)AnimatedSetting.EndValue;//(Color)XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.EndValue);
            }
            if (AnimatedSetting.ReverseStep == null)
            {
                this.checkBoxAutomaticReverse.Checked = true;
            }
        }
Пример #7
0
 public XmlPropertySettingGroup(PropertySettingGroup group)
 {
     foreach (PropertySetting propertySetting in group.PropertySettings)
     {
         string fullName;
         if (propertySetting.Property != null)
         {
             fullName = propertySetting.Property.FullName;
         }
         else if (!string.IsNullOrEmpty(propertySetting.FullName))
         {
             fullName = propertySetting.FullName;
         }
         else
         {
             continue;
         }
         if (propertySetting.EndValue != null)
         {
             XmlAnimatedPropertySetting animatedPropertySetting = new XmlAnimatedPropertySetting();
             animatedPropertySetting.Property = fullName;
             animatedPropertySetting.Value    = propertySetting.Value;
             animatedPropertySetting.EndValue = propertySetting.EndValue;
             this.PropertySettings.Add((XmlPropertySetting)animatedPropertySetting);
         }
         else
         {
             this.PropertySettings.Add(new XmlPropertySetting()
             {
                 Property = fullName,
                 Value    = propertySetting.Value
             });
         }
     }
     if (group.Selector != null)
     {
         this.Selectors.Add(this.CreateSelector(group.Selector));
     }
     if (!string.IsNullOrEmpty(group.BasedOn))
     {
         this.basedOn = group.BasedOn;
     }
     else
     {
         this.basedOn = (string)null;
     }
 }
Пример #8
0
        public override void GetSetting()
        {
            base.GetSetting();

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

            if (!this.checkBoxUseCurrentValue.Checked)
            {
                this.AnimatedSetting.Value = this.colorComboStart.SelectedColor;
            }
            else
            {
                this.AnimatedSetting.Value = null;
            }

            if (this.AnimatedSetting.AnimationType == RadAnimationType.ByStartEndValues)
            {
                this.AnimatedSetting.EndValue = this.colorComboEnd.SelectedColor;
            }
            else
            {
                this.AnimatedSetting.Step = XmlAnimatedPropertySetting.SerializeStep(
                    new ColorAnimationStep(
                        (int)this.upDownStepA.Value,
                        (int)this.upDownStepR.Value,
                        (int)this.upDownStepG.Value,
                        (int)this.upDownStepB.Value
                        )
                    );

                if (!checkBoxAutomaticReverse.Checked)
                {
                    this.AnimatedSetting.ReverseStep = XmlAnimatedPropertySetting.SerializeStep(
                        new ColorAnimationStep(
                            (int)this.upDownReverseStepA.Value,
                            (int)this.upDownReverseStepR.Value,
                            (int)this.upDownReverseStepG.Value,
                            (int)this.upDownReverseStepB.Value
                            )
                        );
                }
            }
        }
Пример #9
0
        private void addPropertySettingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XmlPropertySetting setting = null;

            switch (((ToolStripMenuItem)sender).Name)
            {
            case "AnimatedPropertySetting": setting = new XmlAnimatedPropertySetting(); break;

            case "PropertySetting": setting = new XmlPropertySetting(); break;
            }

            if (tvPropertySettingGroups.SelectedNode != null)
            {
                AddSetting(tvPropertySettingGroups.SelectedNode, setting);
                XmlPropertySettingGroup group = (XmlPropertySettingGroup)tvPropertySettingGroups.SelectedNode.Parent.Tag;
                group.PropertySettings.Add(setting);
                tvPropertySettingGroups.SelectedNode.Expand();
            }
        }
Пример #10
0
        private void FontAnimationForm_Load(object sender, EventArgs e)
        {
            if (AnimatedSetting.Step != null)
            {
                //TODO: What if the step is different type?
                FontAnimationStep step = (FontAnimationStep)XmlAnimatedPropertySetting.DeserializeStep(AnimatedSetting.Step);

                this.tbStepSize.Text = step.SizeStep.ToString();
            }
            else
            {
                this.checkBoxUseCurrentValue.Checked = true;
            }

            if (AnimatedSetting.ReverseStep != null)
            {
                //TODO: What if the step is different type?
                FontAnimationStep step = (FontAnimationStep)XmlAnimatedPropertySetting.DeserializeStep(AnimatedSetting.ReverseStep);

                this.tbReversedStepSize.Text = step.SizeStep.ToString();
            }

            if (AnimatedSetting.Value != null)
            {
                this.tbStartSize.Text = ((Font)AnimatedSetting.Value).Size.ToString(); //((Font)XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.Value)).Size.ToString();
                this.checkBoxUseCurrentValue.Checked = false;
            }
            else
            {
                this.checkBoxUseCurrentValue.Checked = true;
            }


            if (AnimatedSetting.EndValue != null)
            {
                this.tbEndSize.Text = ((Font)AnimatedSetting.EndValue).Size.ToString(); //((Font)XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.EndValue)).Size.ToString();
            }
            if (AnimatedSetting.ReverseStep == null)
            {
                this.checkBoxAutomaticReverse.Checked = true;
            }
        }
Пример #11
0
        public void GetValues()
        {
            XmlAnimatedPropertySetting setting = (Parent as AnimationForm).AnimatedSetting;

            setting.AnimatorStyle     = (AnimatorStyles)this.comboBoxAnimationStyle.SelectedIndex;
            setting.ApplyEasingType   = (RadEasingType)this.comboBoxApplyET.SelectedIndex;
            setting.UnapplyEasingType = (RadEasingType)this.comboBoxUnApplyET.SelectedIndex;
            if (this.numericUpDownInterval.Value == 0)
            {
                this.numericUpDownInterval.Value = 1;
            }
            setting.Interval  = (int)Math.Round((1000 / this.numericUpDownInterval.Value));
            setting.NumFrames = (int)Math.Round((this.numericUpDownFrames.Value / (1000 / this.numericUpDownInterval.Value)));
            if (this.checkBoxInfinitePositions.Checked)
            {
                setting.NumFrames = -1;
            }

            setting.AnimationType = this.AnimationType;
        }
Пример #12
0
 public XmlAnimationStep(object actualStep)
 {
     this.StepType = XmlTheme.SerializeType(actualStep.GetType());
     this.Value    = XmlAnimatedPropertySetting.ConvertValueToString(actualStep);
 }