Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MouseSpeedStyleForm" /> class.
        /// </summary>
        /// <param name="initialStyle">The initial style.</param>
        /// <param name="defaultStyle">The default style to revert to when the override checkbox is unchecked.</param>
        public MouseSpeedStyleForm(MouseSpeedIndicatorStyle initialStyle, MouseSpeedIndicatorStyle defaultStyle)
        {
            this.defaultStyle = defaultStyle ?? throw new ArgumentNullException(nameof(defaultStyle));
            this.initialStyle = initialStyle;

            this.currentStyle = (MouseSpeedIndicatorStyle)initialStyle?.Clone();
            this.InitializeComponent();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MouseSpeedStyleForm" /> class.
        /// </summary>
        /// <param name="initialStyle">The initial style.</param>
        /// <param name="defaultStyle">The default style to revert to when the override checkbox is unchecked.</param>
        public MouseSpeedStyleForm(MouseSpeedIndicatorStyle initialStyle, MouseSpeedIndicatorStyle defaultStyle)
        {
            if (defaultStyle == null) throw new ArgumentNullException(nameof(defaultStyle));

            this.initialStyle = initialStyle;
            this.defaultStyle = defaultStyle;
            this.currentStyle = initialStyle;
            this.InitializeComponent();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Toggles the overwriting of the default style.
        /// </summary>
        private void chkOverwrite_CheckedChanged(object sender, EventArgs e)
        {
            this.defaultMouseSpeed.Enabled = this.chkOverwrite.Checked;

            if (this.chkOverwrite.Checked)
            {
                this.currentStyle = this.initialStyle ?? this.defaultStyle;
                this.defaultMouseSpeed.IndicatorStyle = this.currentStyle;
            }
            else
            {
                this.currentStyle = null;
            }

            this.StyleChanged?.Invoke(this.currentStyle);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Handles change of the style, sets the new style and invokes the changed event.
 /// </summary>
 /// <param name="style">The new style.</param>
 private void defaultMouseSpeed_IndicatorStyleChanged(MouseSpeedIndicatorStyle style)
 {
     this.currentStyle = style;
     this.StyleChanged?.Invoke(style);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Handles change of the style, sets the new style and invokes the changed event.
 /// </summary>
 /// <param name="style">The new style.</param>
 private void defaultMouseSpeed_IndicatorStyleChanged(MouseSpeedIndicatorStyle style)
 {
     this.currentStyle = style;
     this.StyleChanged?.Invoke(style);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Toggles the overwriting of the default style.
        /// </summary>
        private void chkOverwrite_CheckedChanged(object sender, EventArgs e)
        {
            this.defaultMouseSpeed.Enabled = this.chkOverwrite.Checked;

            if (this.chkOverwrite.Checked)
            {
                this.currentStyle = this.initialStyle ?? this.defaultStyle;
                this.defaultMouseSpeed.IndicatorStyle = this.currentStyle;
            }
            else
            {
                this.currentStyle = null;
            }

            this.StyleChanged?.Invoke(this.currentStyle);
        }