Ejemplo n.º 1
0
 private void MainForm_SizeChanged(object sender, EventArgs e)
 {
     if (WindowState.Equals(FormWindowState.Maximized))
     {
         listView_SizeChanged(expenses_listView, null);
     }
 }
Ejemplo n.º 2
0
        //protected override CreateParams CreateParams
        //{
        //    get
        //    {
        //        CreateParams cp = base.CreateParams;
        //        cp.ExStyle |= 0x02000000;
        //        return cp;
        //    }
        //}

        private void TitleLabelClick(object sender, EventArgs e)
        {
            if (CloseLabel.Equals(sender))
            {
                Close();
                //SendDataTest(LANAllComputerIp.ComputerStatus.BREAK_LIEN);
            }
            else
            {
                if (MaxOrMinLabel.Equals(sender))
                {
                    if (WindowState.Equals(FormWindowState.Normal))
                    {
                        WindowState = FormWindowState.Maximized;
                    }
                    else if (WindowState.Equals(FormWindowState.Maximized))
                    {
                        WindowState = FormWindowState.Normal;
                    }
                }
                else
                {
                    WindowState = FormWindowState.Minimized;
                }
            }
        }
Ejemplo n.º 3
0
        void TimerTick(object sender, EventArgs e)
        {
            if (FormBorderStyle.Equals(FormBorderStyle.Sizable) && WindowState.Equals(FormWindowState.Minimized) == false)
            {
                WindowState        = FormWindowState.Minimized;
                Visible            = false;
                ShowIcon           = false;
                notifyIcon.Visible = true;
            }
            else if (Visible == false && ShowIcon == false && notifyIcon.Visible && WindowState.Equals(FormWindowState.Minimized))
            {
                var now = DateTime.Now;
                var sat = Base.CheckIfMarketDelay(now);
                now = now.DayOfWeek switch
                {
                    DayOfWeek.Sunday => now.AddDays(1),
                    DayOfWeek.Saturday => now.AddDays(2),
                    DayOfWeek weeks when weeks.Equals(DayOfWeek.Friday) && now.Hour > (sat ? 9 : 8) => now.AddDays(3),
                    _ => now.Hour > (sat ? 9 : 8) || Array.Exists(Base.Holidays, o => o.Equals(now.ToString(Base.DateFormat))) ? now.AddDays(1) : now,
                };
                sat = Base.CheckIfMarketDelay(now);
                var remain = new DateTime(now.Year, now.Month, now.Day, sat ? 0xA : 9, 0, 0) - DateTime.Now;
                notifyIcon.Text = Base.GetRemainingTime(remain);

                if (API is null && Base.IsDebug is false && remain.TotalMinutes < 0x29 && now.Hour == (sat ? 9 : 8))
                {
                    API            = new ConnectAPI(args);
                    timer.Interval = 0x3A99;
                }
                else if (API is null && Base.IsDebug)
                {
                    API            = new ConnectAPI(administrator);
                    timer.Interval = 0x3A99;
                }
Ejemplo n.º 4
0
        protected override void OnStateChanged(EventArgs e)
        {
            base.OnStateChanged(e);

            if (WindowState.Equals(WindowState.Maximized))
            {
                _appSettings.SidebarMode = false;
            }
            else
            {
                if (WindowState.Equals(WindowState.Minimized))
                {
                    return;
                }

                _appSettings.SidebarMode = _sidebarModeBeforeMaximize;
                if (_appSettings.SidebarMode)
                {
                    TurnOnSidebarMode();
                }
                else
                {
                    TurnOffSidebarMode();
                }

                SetWindowPlacement(true, false);
            }
        }
Ejemplo n.º 5
0
 private void panel3_DoubleClick(object sender, EventArgs e)
 {
     WindowState          = WindowState == FormWindowState.Maximized ? FormWindowState.Normal : FormWindowState.Maximized;
     Region               = Region.FromHrgn(CreateRoundRectRgn(0, 0, Width - 0, Height - 0, 7, 7));
     Settings.Default.max = WindowState.Equals(FormWindowState.Maximized);
     Settings.Default.Save();
 }
Ejemplo n.º 6
0
 private void WindowActivated(object sender, EventArgs e)
 {
     if (WindowState.Equals(WindowState.Normal))
     {
         videoImageControl.Start();
     }
 }
Ejemplo n.º 7
0
 private void MainWindow_OnSizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (WindowState.Equals(WindowState.Normal))
     {
         _size = e.NewSize;
     }
 }
Ejemplo n.º 8
0
 private void WindowDeactivated(object sender, EventArgs e)
 {
     if (WindowState.Equals(WindowState.Minimized))
     {
         videoImageControl.Stop();
     }
 }
Ejemplo n.º 9
0
        void TimerTick(object sender, EventArgs e)
        {
            if (FormBorderStyle.Equals(FormBorderStyle.Sizable) && WindowState.Equals(FormWindowState.Minimized) == false && Result.Equals(DialogResult.Yes))
            {
                FormBorderStyle = FormBorderStyle.FixedSingle;
                WindowState     = FormWindowState.Minimized;
            }
            else if (DateTime.Now.Hour < 3 && backgroundWorker.IsBusy == false &&
                     DateTime.Now.DayOfWeek.Equals(DayOfWeek.Sunday) &&
                     (cookie as string).Equals(admin) == false)
            {
                timer.Stop();
                strip.ItemClicked -= OnItemClick;
                GetSettleTheFare();
                Dispose();
            }
            else if (Visible == false && ShowIcon == false && notifyIcon.Visible && WindowState.Equals(FormWindowState.Minimized))
            {
                notifyIcon.Icon = (Icon)resources.GetObject(Change ? upload : download);
                Change          = !Change;

                if (IsApplicationAlreadyRunning(Privacy.Security) == false && backgroundWorker.IsBusy == false &&
                    string.IsNullOrEmpty(Privacy.Account) && string.IsNullOrEmpty(Privacy.SecuritiesAPI) && string.IsNullOrEmpty(Privacy.SecurityAPI))
                {
                    strip.Items.Find(st, false).First(o => o.Name.Equals(st)).PerformClick();
                }
            }
            else
            {
                Statistical.CheckForSurvival(colors[DateTime.Now.Second % 3]);
            }
        }
Ejemplo n.º 10
0
        private void doLogin()
        {
            if (!loaded)
            {
                return;
            }
            // TODO clear session vars
            enVars.successLogin = false;
            if (WindowState.Equals(FormWindowState.Minimized))
            {
                return;
            }

            // 'If Application.OpenForms().OfType(Of SplashScreen).Any Then
            // 'Exit Sub
            // 'End If

            // 'Me.Hide()
            // ' If splashScreenLogin.ShowDialog() = DialogResult.OK Then
            // 'Me.Show()
            // 'Else
            // 'Application.Exit()
            // 'Close()
            // 'End If
        }
Ejemplo n.º 11
0
 private void WindowDeactivated(object sender, EventArgs e)
 {
     // Stop rendering when minimized
     if (WindowState.Equals(WindowState.Minimized))
     {
         videoImageControl.Stop(false); // Passing false, true would stop visualization on tracker level
     }
 }
Ejemplo n.º 12
0
 private void WindowActivated(object sender, EventArgs e)
 {
     // Rendering video when active/visible
     if (WindowState.Equals(WindowState.Normal))
     {
         videoImageControl.Start();
     }
 }
Ejemplo n.º 13
0
 private void GoblinBatResize(object sender, EventArgs e)
 {
     if (WindowState.Equals(FormWindowState.Minimized))
     {
         Visible            = false;
         ShowIcon           = false;
         notifyIcon.Visible = true;
     }
 }
        private void Window1_Deactivated(object sender, EventArgs e)
        {
            if (WindowState.Equals(WindowState.Minimized))
            {
                videoImageControl.Stop(true);
            }

            videoImageControl.VideoOverlayTopMost = false;
        }
        private void Window1_Deactivated(object sender, EventArgs e)
        {
            lblTitle.FontSize = GazeTrackerUIMainWindow.FontSize;
            if (WindowState.Equals(WindowState.Minimized))
            {
                videoImageControl.Stop(true);
            }

            videoImageControl.VideoOverlayTopMost = false;
        }
Ejemplo n.º 16
0
        //modified for testing purpose

        public bool check_minimize(string n)
        {
            WindowState = FormWindowState.Minimized;

            if (WindowState.Equals(n))
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 17
0
        private void mnuMain_Resize(object sender, EventArgs e)
        {
            if (!WindowState.Equals(FormWindowState.Minimized))
            {
                return;
            }

            Hide();
            _notifyIcon.Visible = true;
            _notifyIcon.ShowBalloonTip(3000);
        }
Ejemplo n.º 18
0
 private void ChangeStateButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (WindowState.Equals(WindowState.Normal))
     {
         WindowState = WindowState.Maximized;
     }
     else
     {
         WindowState = WindowState.Normal;
     }
 }
Ejemplo n.º 19
0
 private void max_Click(object sender, EventArgs e)
 {
     if (WindowState.Equals(FormWindowState.Maximized))
     {
         WindowState = FormWindowState.Normal;
     }
     else
     {
         WindowState = FormWindowState.Maximized;
     }
 }
Ejemplo n.º 20
0
 // Resizes the form
 private void guna2Button2_Click(object sender, EventArgs e)
 {
     if (WindowState.Equals(FormWindowState.Normal))
     {
         WindowState = FormWindowState.Maximized;
     }
     else if (WindowState.Equals(FormWindowState.Maximized))
     {
         WindowState = FormWindowState.Normal;
     }
 }
Ejemplo n.º 21
0
 private void btnMaximizar_Click(object sender, EventArgs e)
 {
     //this.StartPosition = FormStartPosition.CenterScreen;
     if (WindowState.Equals(FormWindowState.Normal))
     {
         WindowState = FormWindowState.Maximized;
     }
     else
     {
         WindowState = FormWindowState.Normal;
     }
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Resize
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void Button_Click_Resize(object sender, RoutedEventArgs e)
 {
     if (WindowState.Equals(WindowState.Normal))
     {
         WindowState          = WindowState.Maximized;
         resizeButton.Content = ">";
     }
     else
     {
         WindowState          = WindowState.Normal;
         resizeButton.Content = "<";
     }
 }
Ejemplo n.º 23
0
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if (msg == 562) // WM_EXITSIZEMOVE after window move / size changed
            {
                SetToggleButton();

                if (!WindowState.Equals(WindowState.Maximized))
                {
                    SaveWindowsPlacement();
                }
            }

            return(IntPtr.Zero);
        }
Ejemplo n.º 24
0
 protected override void OnSizeChanged(EventArgs e)
 {
     base.OnSizeChanged(e);
     if (WindowState.Equals(FormWindowState.Minimized) && Properties.Settings.Default.MinimizeToTray)
     {
         Hide();
         if (Properties.Settings.Default.FirstTimeTray != false)
         {
             NotifyArea.ShowStatusTray(Languages.Parse("Information"), Languages.Parse("MinimizedToTray"), ToolTipIcon.Info);
             Properties.Settings.Default.FirstTimeTray = false;
             Properties.Settings.Default.Save();
         }
     }
 }
Ejemplo n.º 25
0
 private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.RightButton.Equals(MouseButtonState.Pressed))
     {
         return;
     }
     if (e.LeftButton.Equals(MouseButtonState.Pressed) && e.ClickCount.Equals(2))
     {
         WindowState = WindowState.Equals(WindowState.Maximized) ? WindowState.Normal : WindowState.Maximized;
         return;
     }
     this.Cursor = Cursors.ScrollAll;
     this.DragMove();
     this.Cursor = Cursors.Arrow;
 }
Ejemplo n.º 26
0
 protected void FullScreenMode()
 {
     Topmost     = true;
     ResizeMode  = ResizeMode.CanMinimize;
     WindowStyle = WindowStyle.None;
     if (WindowState.Equals(WindowState.Maximized))
     { // Needed for maximized windows
         SystemCommands.RestoreWindow(this);
         WasMaximized = true;
     }
     else
     {
         WasMaximized = false;
     }
     SystemCommands.MaximizeWindow(this);
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Gets triggered when the main window is maximized. If our windows are hidden, sets the to visible
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MainWindow_StateChanged(object sender, EventArgs e)
 {
     if (WindowState.Equals(WindowState.Maximized))
     {
         foreach (ProgramWindow ourWindow in WindowList)
         {
             if (ourWindow.Visible == false && !_selectWindowActivated)
             {
                 ourWindow.Show();
             }
         }
     }
     else if (WindowState.Equals(WindowState.Minimized))
     {
         // Do Stuff Here
     }
 }
Ejemplo n.º 28
0
        void GoblinBatResize(object sender, EventArgs e)
        {
            if (WindowState.Equals(FormWindowState.Minimized))
            {
                if (string.IsNullOrEmpty(OnClickMinimized) == false && OnClickMinimized.Equals(st))
                {
                    Statistical.Hide();
                }

                Opacity            = 0.8135;
                BackColor          = Color.FromArgb(0x79, 0x85, 0x82);
                Visible            = false;
                ShowIcon           = false;
                ClosingForm        = false;
                notifyIcon.Visible = true;
            }
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Sets the window to fullscreen according to the position of the taskbar and back to normal.
        /// </summary>
        private void SetFullscreenWindow()
        {
            if (winState.Equals(WindowState.Normal))
            {
                // Checking which side the taskbar is on.
                if (SystemParameters.WorkArea.Left > 0)
                {
                    mWindow.Top  = 0;
                    mWindow.Left = SystemParameters.PrimaryScreenWidth - SystemParameters.WorkArea.Width;
                }
                else if (SystemParameters.WorkArea.Top > 0)
                {
                    mWindow.Top  = SystemParameters.PrimaryScreenHeight - SystemParameters.WorkArea.Height;
                    mWindow.Left = 0;
                }
                else if (SystemParameters.WorkArea.Left == 0 && SystemParameters.WorkArea.Width < SystemParameters.PrimaryScreenWidth)
                {
                    mWindow.Top  = SystemParameters.PrimaryScreenHeight - SystemParameters.WorkArea.Height;
                    mWindow.Left = 0;
                }
                else
                {
                    mWindow.Top  = 0;
                    mWindow.Left = 0;
                }

                winState     = WindowState.Maximized;
                WindowWidth  = SystemParameters.WorkArea.Width;
                WindowHeight = SystemParameters.WorkArea.Height;
            }
            else
            {
                // Set window back to normal size.
                winState     = WindowState.Normal;
                WindowWidth  = SystemParameters.PrimaryScreenWidth * 0.65;
                WindowHeight = SystemParameters.PrimaryScreenHeight * 0.65;
                mWindow.Left = (SystemParameters.PrimaryScreenWidth - WindowWidth) / 2;
                mWindow.Top  = (SystemParameters.PrimaryScreenHeight - WindowHeight) / 2;
            }
        }
Ejemplo n.º 30
0
        private void StartUpResize(object sender, EventArgs e)
        {
            BeginInvoke(new Action(() =>
            {
                if (WindowState.Equals(FormWindowState.Minimized))
                {
                    switch (OnClickMinimized)
                    {
                    case "quotes":
                        API.SendQuotes -= Quotes.OnReceiveQuotes;
                        API.SendState  -= Quotes.OnReceiveState;
                        API.SendTrend  -= Quotes.OnReceiveTrend;
                        Quotes.Hide();
                        break;

                    case "account":
                        API.SendDeposit -= Account.OnReceiveDeposit;
                        Account.Hide();
                        break;

                    case "balance":
                        API.SendCurrent    -= Balance.OnRealTimeCurrentPriceReflect;
                        API.SendBalance    -= Balance.OnReceiveBalance;
                        Balance.SendReSize -= OnReceiveSize;
                        Balance.Hide();
                        break;

                    case "strategy":
                        Statistical.Hide();
                        break;
                    }
                    ;
                    Visible            = false;
                    ShowIcon           = false;
                    notifyIcon.Visible = true;
                }
            }));
        }