private void ApplyPushedState()
        {
            PictureBoxState state = _endState;

            state.Apply(_pushedState, _pushProperties);
            base.State = state;
        }
        /// <summary>
        /// Creates a new instance.
        /// </summary>
        public AnimatedPictureButton()
        {
            InitializeComponent();

            _startState = DefaultStartState;
            _endState = DefaultEndState;
            _pushedState = DefaultPushedState;
            base.ShadowMode = DEFAULT_SHADOW_MODE;

            base.State = _startState;

            UpdateSettings();
        }
        /// <summary>
        /// Creates a new instance.
        /// </summary>
        public AnimatedPictureButton()
        {
            InitializeComponent();

            _startState     = DefaultStartState;
            _endState       = DefaultEndState;
            _pushedState    = DefaultPushedState;
            base.ShadowMode = DEFAULT_SHADOW_MODE;

            base.State = _startState;

            UpdateSettings();
        }
Beispiel #4
0
        /// <summary>
        /// Creates a new empty instance.
        /// </summary>
        public AnimatedPicturesProgressBar()
        {
            InitializeComponent();

            _steps = new ProgressStepCollection();

            _initialState    = DefaultInitialState;
            _inProgressState = DefaultInProgressState;
            _finishedState   = DefaultFinishedState;

            _initialExtraImage    = DefaultInitialExtraImage;
            _inProgressExtraImage = DefaultInProgressExtraImage;
            _finishedExtraImage   = DefaultFinishedExtraImage;
        }
        /// <summary>
        /// Creates a new empty instance.
        /// </summary>
        public AnimatedPicturesProgressBar()
        {
            InitializeComponent();

            _steps = new ProgressStepCollection();

            _initialState = DefaultInitialState;
            _inProgressState = DefaultInProgressState;
            _finishedState = DefaultFinishedState;

            _initialExtraImage = DefaultInitialExtraImage;
            _inProgressExtraImage = DefaultInProgressExtraImage;
            _finishedExtraImage = DefaultFinishedExtraImage;
        }
Beispiel #6
0
 /// <summary>
 /// Updates the ending state of the contained animator.
 /// </summary>
 /// <param name="state">State to set.</param>
 protected void UpdateEndValues(PictureBoxState state)
 {
     _stateAnimator.EndState = state;
 }
Beispiel #7
0
 /// <summary>
 /// Updates the starting state of the contained animator.
 /// </summary>
 /// <param name="state">State to set.</param>
 protected void UpdateStartValues(PictureBoxState state)
 {
     _stateAnimator.StartState = state;
 }
Beispiel #8
0
 /// <summary>
 /// Animates from the last end state to the given new state.
 /// </summary>
 /// <param name="state">Destination state of the animation.</param>
 public void Animate(PictureBoxState state)
 {
     UpdateEndValues(state);
     _stateAnimator.Start(true);
 }
 /// <summary>
 /// Applies the a defined set of properties from a given state to the current instance.
 /// </summary>
 /// <param name="state">State from which to transfer the properties.</param>
 /// <param name="properties">Definition of which properties to transfer.</param>
 public void Apply(PictureBoxState state, PictureBoxStateProperties properties)
 {
     if (IsPropertySet(properties, PictureBoxStateProperties.Alpha))
     {
         _alpha = state._alpha;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.RotationAngle))
     {
         _rotationAngle = state._rotationAngle;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.Zoom))
     {
         _zoom = state._zoom;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.ExtraImageRotationAngle))
     {
         _extraImageRotationAngle = state._extraImageRotationAngle;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.BackColorGradientRotationAngle))
     {
         _backColorGradientRotationAngle = state._backColorGradientRotationAngle;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.BackColor))
     {
         _backColor = state._backColor;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.BackColor2))
     {
         _backColor2 = state._backColor2;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.ForeColor))
     {
         _foreColor = state._foreColor;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.TextHaloColor))
     {
         _textHaloColor = state._textHaloColor;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.TextHaloWidth))
     {
         _textHaloWidth = state._textHaloWidth;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.TextRotationAngle))
     {
         _textRotationAngle = state._textRotationAngle;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.TextZoom))
     {
         _textZoom = state._textZoom;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.ShadowOffset))
     {
         _shadowOffset = state._shadowOffset;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.ImageOffset))
     {
         _imageOffset = state._imageOffset;
     }
     if (IsPropertySet(properties, PictureBoxStateProperties.TextOffset))
     {
         _textOffset = state._textOffset;
     }
 }
 /// <summary>
 /// Updates the starting state of the contained animator.
 /// </summary>
 /// <param name="state">State to set.</param>
 protected void UpdateStartValues(PictureBoxState state)
 {
     _stateAnimator.StartState = state;
 }
 /// <summary>
 /// Updates the ending state of the contained animator.
 /// </summary>
 /// <param name="state">State to set.</param>
 protected void UpdateEndValues(PictureBoxState state)
 {
     _stateAnimator.EndState = state;
 }
 /// <summary>
 /// Animates from the last end state to the given new state.
 /// </summary>
 /// <param name="state">Destination state of the animation.</param>
 public void Animate(PictureBoxState state)
 {
     UpdateEndValues(state);
     _stateAnimator.Start(true);
 }
Beispiel #13
0
 /// <summary>
 /// Applies the a defined set of properties from a given state to the current instance.
 /// </summary>
 /// <param name="state">State from which to transfer the properties.</param>
 /// <param name="properties">Definition of which properties to transfer.</param>
 public void Apply(PictureBoxState state, PictureBoxStateProperties properties)
 {
     if (IsPropertySet(properties, PictureBoxStateProperties.Alpha))
         _alpha = state._alpha;
     if (IsPropertySet(properties, PictureBoxStateProperties.RotationAngle))
         _rotationAngle = state._rotationAngle;
     if (IsPropertySet(properties, PictureBoxStateProperties.Zoom))
         _zoom = state._zoom;
     if (IsPropertySet(properties, PictureBoxStateProperties.ExtraImageRotationAngle))
         _extraImageRotationAngle = state._extraImageRotationAngle;
     if (IsPropertySet(properties, PictureBoxStateProperties.BackColorGradientRotationAngle))
         _backColorGradientRotationAngle = state._backColorGradientRotationAngle;
     if (IsPropertySet(properties, PictureBoxStateProperties.BackColor))
         _backColor = state._backColor;
     if (IsPropertySet(properties, PictureBoxStateProperties.BackColor2))
         _backColor2 = state._backColor2;
     if (IsPropertySet(properties, PictureBoxStateProperties.ForeColor))
         _foreColor = state._foreColor;
     if (IsPropertySet(properties, PictureBoxStateProperties.TextHaloColor))
         _textHaloColor = state._textHaloColor;
     if (IsPropertySet(properties, PictureBoxStateProperties.TextHaloWidth))
         _textHaloWidth = state._textHaloWidth;
     if (IsPropertySet(properties, PictureBoxStateProperties.TextRotationAngle))
         _textRotationAngle = state._textRotationAngle;
     if (IsPropertySet(properties, PictureBoxStateProperties.TextZoom))
         _textZoom = state._textZoom;
     if (IsPropertySet(properties, PictureBoxStateProperties.ShadowOffset))
         _shadowOffset = state._shadowOffset;
     if (IsPropertySet(properties, PictureBoxStateProperties.ImageOffset))
         _imageOffset = state._imageOffset;
     if (IsPropertySet(properties, PictureBoxStateProperties.TextOffset))
         _textOffset = state._textOffset;
 }