WinFormsPopupAlerts/SimplePopupAlert.cs

(开头部分) 6KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing;

namespace WinFormsPopupAlerts
{
    public class SimplePopupAlert : PopupAlert
    {
        public SimplePopupAlert()
        {

        }

        public SimplePopupAlert(object[] args)
            : base(args)
        {

        }

        public override void Hide(Action<PopupAlert> callback)
        {
            if (HiddingStyle == HiddingStyle.Fade)
            {
                Action<PopupAlert> hidding = new Action<PopupAlert>(delegate(PopupAlert obj)
                {
                    float v = 1f / (float)HiddingDuration;
                    System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                    sw.Start();
                    while (obj.Opacity > 0)
                    {
                        int msec = (int)sw.ElapsedMilliseconds;
                        obj.Invoke(new MethodInvoker(delegate() { obj.Opacity = 1 - v * msec; }));
                        System.Threading.Thread.Sleep(10);
                    }
                    obj.Invoke(new MethodInvoker(delegate() { ((Control)obj).Hide(); }));
                    callback(obj);
                });
                hidding.BeginInvoke(this, null, null);
            }
            else if (HiddingStyle == HiddingStyle.Simple)
            {
                ((Control)this).Hide();
            }
            else
            {
                throw new Exception("Unknown HiddingStyle");
            }

        }


        private GraphicsPath GetCapsule(RectangleF baseRect)
        {
            float diameter;
            RectangleF arc;
            GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
            try
后面还有 162 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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