src/Core/Controls/XRails_Button.cs

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*  XRails_Button.cs
**  Copyright (C) 2017, Jad Altahan
** 
**  This software may be modified and 
**  distributed under the terms of the
**  MIT license. See the LICENSE file
**  for details.
** 
**  http://github.com/xv
**  mailto:xviyy@aol.com
*/

using System.ComponentModel;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.Windows.Forms;
using System;
using XRails.Classes;

namespace XRails.Controls
{
    public class XRails_Button : Control, IButtonControl
    {
        #region Fields

        private readonly Timer animationTimer;
        private int buttonGlow;
        private int stringGlow;
        private bool hoverButton;

        private int mouseState;

        private float margin, width, height;
        private Rectangle stringRect;
        private RectangleF buttonRect;
        private GraphicsPath roundRectPath;

        #endregion
        #region Properties

        [Browsable(false)]
        [Description("The foreground color of this component, which is used to display text.")]
        public override Color ForeColor { get; set; }

        private int _Radius = 20;
        [Browsable(true)]
        [Description("Sets the radius of curvature for the control.")]
        public int Radius
        {
            get { return _Radius; }
            set
            {
                if (!(value < 1 || value > 20))
                    _Radius = value;
                else
                    throw new Exception("The entered value cannot be less than 1 or greater than 20.");

                Invalidate();
            }
        }
后面还有 319 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。