Esempio n. 1
0
        public bool Notify(NotifyData Notify)
        {
            try
            {
                NotifyInstance = new frmNotify(Notify);
                NotifyInstance.Show();

                return(true);
            }
            catch (Exception e)
            {
                Notify.Failed?.Invoke(e);

                return(false);
            }
        }
Esempio n. 2
0
        public frmNotify(NotifyData notify)
        {
            InitializeComponent();

            if (notify.Icon == null)
            {
                notify.Icon = Properties.Resources.NotifyIcon;
            }

            if (notify.OnSound)
            {
                Stream      stream = Properties.Resources.NotifySound;
                SoundPlayer snd    = new SoundPlayer(stream);
                snd.Play();
            }
            this.Source = notify;

            // TopMost
            SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

            EnterX = 360;
            this.FormBorderStyle = FormBorderStyle.None;
            this.PrepareDrawing();
        }