Exemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();

            this.MinimumSize = this.ClientSize;

            if (rtaGlassEffect.GlassEnabled)
            {
                this._glass = new rtaGlassEffect
                {
                    UseHandCursorOnTitle = false,
                    TopBarSize           = this.ClientSize.Height - 44,
                    LeftBarSize          = 1,
                    RightBarSize         = 1,
                    BottomBarSize        = 1
                };

                this._glass.ShowEffect(this);
            }

            AppEvents.On(AppEventType.ChatOpened, e =>
            {
                this.InvokeEx(t =>
                {
                    Dialog chat = (Dialog)e.Data[0];

                    t.Text = chat.Title + @" - WinVK";
                    t.encryptCB.Checked = (chat.Crypt && !String.IsNullOrEmpty(chat.CryptKey));
                });
            });
        }
Exemplo n.º 2
0
        private Notification(String text, String title = "", int time = 0)
        {
            InitializeComponent();

            this.MinimumSize = this.MaximumSize = this.ClientSize;

            this.Title = title;
            this.Text  = text;

            this._time = time;
            if (this._time > 0)
            {
                this._timer = new Timer(obj =>
                {
                    this.InvokeEx(f => f.Close());
                }, null, (long)this._time, Timeout.Infinite);
            }

            rtaGlassEffect glass = new rtaGlassEffect {
                UseHandCursorOnTitle = false, TopBarSize = -9999, BottomBarSize = 9999
            };

            glass.ShowEffect(this);

            if (_scr == Rectangle.Empty)
            {
                _scr = Screen.GetWorkingArea(this);
            }

            this._x = _scr.Width - this.Width;
            this._y = _scr.Height - _lastHeight;

            _lastHeight += this.Height;
            ActiveNotifications.Add(this);

            this.Left = _x;
            this.Top  = _scr.Height;

            FormTransform.Transform(this, this.Size, new Point(_x, _y - this.Height));
        }