protected override void OnClosing(CancelEventArgs e) {
   base.OnClosing(e);
   if (MainFormManager.MainForm.Views.OfType<IContentView>().Any(v => v.Content is IStorableContent)) {
     if (MessageBox.Show(this, "Some views are still opened. If their content has not been saved, it will be lost after closing. Do you really want to close HeuristicLab Optimizer?", "Close Optimizer", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
       e.Cancel = true;
   }
 }
Example #2
0
        private void SizeValidation(object sender, CancelEventArgs e)
        {
            if (!(sender is TextBox)) { return; }

            Regex sizeReg = new Regex(@"^\d{1,4}$");
            string errorMessage = "Некорректный размер изображения";
            TextBox currentTextBox = sender as TextBox;

            if (!sizeReg.IsMatch(currentTextBox.Text))
            {
                this.errorProvider1.SetError(currentTextBox, errorMessage);
                this.isValid = false;
            }
            else
            {
                this.isValid = true;
                this.errorProvider1.SetError(currentTextBox, "");
                switch (currentTextBox.Name)
                {
                    case "tb_width":
                        this.ImageWidth = Int32.Parse(this.tb_width.Text);
                        break;
                    case "tb_heigth":
                        this.ImageHeight = Int32.Parse(this.tb_heigth.Text);
                        break;
                    default:
                        break;
                }
            }
        }
Example #3
0
        protected override void OnClosing(CancelEventArgs e)
        {
            this.Control.Session.StateChanged -= new EventHandler<EventArgs>(Session_StateChanged);

            var state = App.Settings.Current.Windows.States[this.Control.Context.Key];

            if (this.Control.Parent != null)
            {
                if (this.Control.IsConnected && this.Control.IsChannel)
                {
                    this.Control.Session.Part(this.Control.Target.Name);
                }
                state.IsDetached = true;
                this.Control.Dispose();
            }
            else
            {
                state.IsDetached = false;
                var window = App.Current.MainWindow as ChatWindow;
                if (window != null)
                {
                    window.Attach(this.Control);
                }
            }
            state.Placement = Interop.WindowHelper.Save(this);
        }
Example #4
0
 private void ctxObjects_Opening(object sender, CancelEventArgs e)
 {
   if (this.viewer == null)
   {
     e.Cancel = true;
   }
   else
   {
     switch (this.listView.SelectedIndices.Count)
     {
       case 0:
         this.ctxObjects_Add.Enabled = true;
         this.ctxObjects_Edit.Enabled = false;
         this.ctxObjects_Delete.Enabled = false;
         break;
       case 1:
         this.ctxObjects_Add.Enabled = true;
         this.ctxObjects_Edit.Enabled = true;
         this.ctxObjects_Delete.Enabled = true;
         break;
       default:
         this.ctxObjects_Add.Enabled = true;
         this.ctxObjects_Edit.Enabled = false;
         this.ctxObjects_Delete.Enabled = true;
         break;
     }
   }
 }
Example #5
0
 protected override void OnClosing(CancelEventArgs e)
 {
     string json = _jsonSerializer.Serialize(_storageAccountConnections);
     File.WriteAllText(SettingsFilePath, json);
     _deploymentConfigFileWatcher.Dispose();
     base.OnClosing(e);
 }
 private void Window_Closing(object sender, CancelEventArgs e)
 {
     if(_timer != null && _timer.Enabled == true)
     {
         _timer.Enabled = false;
     }
 }
Example #7
0
        // Closing
        private void mainWindow_Closing(object sender, CancelEventArgs e)
        {
            // If the document needs to be saved
            if (_needsToBeSaved)
            {
                // Configure the message box
                var messageBoxText =
                    "This document needs to be saved. Click Yes to save and exit, No to exit without saving, or Cancel to not exit.";
                var caption = "Word Processor";
                var button = MessageBoxButton.YesNoCancel;
                var icon = MessageBoxImage.Warning;

                // Display message box
                var messageBoxResult = MessageBox.Show(messageBoxText, caption, button, icon);

                // Process message box results
                switch (messageBoxResult)
                {
                    case MessageBoxResult.Yes: // Save document and exit
                        SaveDocument();
                        break;
                    case MessageBoxResult.No: // Exit without saving
                        break;
                    case MessageBoxResult.Cancel: // Don't exit
                        e.Cancel = true;
                        break;
                }
            }
        }
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            if (DialogResult == DialogResult.OK)
                HandleEvent(ApplyFilterChanges);
        }
Example #9
0
 private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
 {
     string linija = "";
     int broj = 0;
     bool ide = true;
     try
     {
         using (StreamReader sr = new StreamReader(openFileDialog1.FileName))
         {
             while (ide)
             {
                 linija = sr.ReadLine();
                 if (linija == null) ide = false;
                 string prezime = linija.Split(',')[0];
                 string ime = linija.Split(',')[1];
                 broj++;
                 Igrac igrac_za_unos = new Igrac(ime, prezime);
                 Igrac_GA igrac_za_unos_GA = new Igrac_GA();
                 igrac_za_unos_GA.Daj_Ime_i_prezime = ime + " " + prezime;
                 lista_za_upis.Add(igrac_za_unos);
                 lista_Za_upis_GA.Add(igrac_za_unos_GA);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("The file could not be read:");
         Console.WriteLine(ex.Message);
     }
     foreach (Igrac i in lista_za_upis)
     {
         richTextBox1.Text += lista_za_upis.IndexOf(i) + ". " + i + " \n";
     }
 }
Example #10
0
 private void tbWord_Validating(object sender, CancelEventArgs e)
 {
     if (tbWord.Text.Trim().Length == 0)
     {
         errorProvider1.SetError(tbWord, "Внесете збор!");
     }
 }
Example #11
0
        private void ValidateTextBox( object sender, CancelEventArgs e )
        {
            bool nameValid = true, passwordValid = true;

              if (String.IsNullOrEmpty(((TextBox)sender).Text))
              {
            switch (Convert.ToByte(((TextBox)sender).Tag))
            {
              case 0:
            errorProvider1.SetError(tbName, "Please, enter your name");
            nameValid = false;
            break;
              case 1:
            errorProvider1.SetError(tbPassword, "Please, enter your password");
            passwordValid = false;
            break;
            }
              }
              else
              {
            switch (Convert.ToByte(((TextBox)sender).Tag))
            {
              case 0:
            errorProvider1.SetError(tbName, "");
            break;
              case 1: errorProvider1.SetError(tbPassword, "");
            break;
            }
              }
              _validForm = nameValid && passwordValid;
        }
        private void maskedTextBoxDateFin_Validating(object sender, CancelEventArgs e)
        {


            if (DateTime.TryParse(maskedTextBoxDateFin.Text, out dateFin))
            {

                errorProviderDateFin.SetError(maskedTextBoxDateFin, string.Empty);
                if (dateFin <= dateDebut)
                {
                    dateIsOk = false;
                    errorProviderDateFin.SetError(maskedTextBoxDateFin, "Attention la date saisie se situe avant la date de début");
                    maskedTextBoxDateFin.Focus();

                }
                else
                {
                    dateIsOk = true;
                    errorProviderDateFin.SetError(maskedTextBoxDateFin, string.Empty);
                }
            }
            else
            {
                dateIsOk = false;
                errorProviderDateFin.SetError(maskedTextBoxDateFin, " Veuillez entrer une date au format valide");
            }

        }
		protected override void OnClosing(CancelEventArgs e)
		{
			if (_token != null)
			{
				if (Sync.IsEnabled)
				{
					var result =
						new MessageBoxBuilder()
							.Text(LocalizedStrings.Str2928)
							.Error()
							.YesNo()
							.Owner(this)
							.Show();

					if (result == MessageBoxResult.Yes)
					{
						StopSync();
					}
				}

				e.Cancel = true;
			}

			base.OnClosing(e);
		}
        protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
        {
            if (mLastClickedButton == null) return;
            string ColName = this.DataGridViewColumn.DataPropertyName;
            string btnText = mLastClickedButton.Text;
            FilterCaption = OriginalDataGridViewColumnHeaderText + "\n = " + btnText;

            switch (btnText) {
                case "A...D":
                    FilterExpression = "(" + ColName + ">='A' AND "+ColName+"<='DZ')";
                    break;
                case "E...H":
                    FilterExpression = "(" + ColName + ">='E' AND " + ColName + "<='HZ')";
                    break;
                case "I...L":
                    FilterExpression = "(" + ColName + ">='I' AND " + ColName + "<='LZ')";
                    break;
                case "M...P":
                    FilterExpression = "(" + ColName + ">='M' AND " + ColName + "<='PZ')";
                    break;
                case "Q...T":
                    FilterExpression = "(" + ColName + ">='Q' AND " + ColName + "<='TZ')";
                    break;
                case "U...Z":
                    FilterExpression = "(" + ColName + ">='U' AND " + ColName + "<='ZZ')";
                    break;
            }
            Active = true;
            //Apply the filter immediately
            FilterManager.RebuildFilter();
        }
Example #15
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            //Settings Save
            Settings.Default.gpxLastSummary = chExportSummary.Checked;
            Settings.Default.gpxLastComprehensive = chExportComp.Checked;
            Settings.Default.gpxLastEachAp = chExportEachAp.Checked;

            Settings.Default.gpxLastOrganizeEThenC = cmbOrganize.SelectedIndex == 0;

            Settings.Default.gpxLastRssiLabels = chShowRssiMarkers.Checked;

            Settings.Default.gpxLastGpsLockedup = chGPSLockup.Checked;
            Settings.Default.gpxLastGpsFixLost = chGPSFixLost.Checked;
            Settings.Default.gpxLastMinimumSatsEnabled = chGPSsatCount.Checked;
            Settings.Default.gpxLastMinimumStas = (int)numSatCount.Value;

            Settings.Default.gpxLastMaxSpeedEnabled = chMaxSpeed.Checked;
            Settings.Default.gpxLastMaxSpeed = (int)numMaxSpeed.Value;

            Settings.Default.gpxLastMaxRssiEnabled = chMaxSignal.Checked;
            Settings.Default.gpxLastMaxRssi = (int)numMaxSignal.Value;

            //Save input file(s)
            //(Settings.Default.gpxLastInputFiles ?? (Settings.Default.gpxLastInputFiles = new StringCollection())).AddRange(openFile.FileNames);
            if (_inFiles != null)
            {
                (Settings.Default.gpxLastInputFiles = new StringCollection()).AddRange(_inFiles);
            }

            Settings.Default.gpxLastOutputDir = txtOutDir.Text;
        }
Example #16
0
        private void PageSuccess_SetActive(object sender, CancelEventArgs e)
        {
            try
            {
                SetWizardButtons(Wizard.UI.WizardButtons.Finish);

                if (m_wiz.CreateOp != null)
                {
                    lblOp.Text = "Teambox creation:";
                    lblExplanation.Text =
                        "Congratulations! Your Teambox has been successfully created." + Environment.NewLine +
                        "Please press on Finish to go back to your Teambox manager.";
                }

                else
                {
                    lblOp.Text = "Teambox invitation:";
                    lblExplanation.Text =
                        "Congratulations! Your invitations have been successfully processed. " +
                        "Your recipients will receive an email in their inbox in the next minutes." +
                        Environment.NewLine +
                        "Please press on Finish to go back to your Teambox manager.";
                }
            }
            catch (Exception ex)
            {
                Base.HandleException(ex);
            }
        }
 private void Window_OnClosing(object sender, CancelEventArgs e)
 {
     var vm = (FocusTrackerToolWindowViewModel)this.DataContext;
     vm.Remove();
     //((ToolWindow)sender).Hide();
     //e.Cancel = true;
 }
		public bool FireValidating()
		{
			CancelEventArgs cancelEventArgs = new CancelEventArgs();
			this.OnValidating(cancelEventArgs);

			return cancelEventArgs.Cancel;
		}
Example #19
0
 private void UserAppointUrlText_Validating(object sender, CancelEventArgs e)
 {
     if (!UserAppointUrlText.Text.StartsWith("http") && !string.IsNullOrEmpty(UserAppointUrlText.Text))
     {
         MessageBox.Show("Text Error:正しいURLではありません");
     }
 }
Example #20
0
        private void contextMenu_Opening(object sender, CancelEventArgs e)
        {
            if (_currentItem == null)
            {
                //e.Cancel = true;
                return;
            }

            for (int i = _contextMenu.Items.Count - 1; i >= 0; i--)
            {
                if (_contextMenu.Items[i] is ToolStripSeparator)
                    break;
                _contextMenu.Items.RemoveAt(i);
            }

            if (_currentItem != null && _currentItem.Tag is IssueItemView)
            {
                IssueItemView issue = (IssueItemView)_currentItem.Tag;
                foreach (IIssueAction action in issue.GetActions())
                {
                    ActionMenuItem menu = new ActionMenuItem(issue, action);
                    menu.Click += new EventHandler(RefreshContents);
                    _contextMenu.Items.Add(menu);
                }
            }
        }
Example #21
0
 private void CasparCGPortTextBox_Validating(object sender, CancelEventArgs e)
 {
     if (!System.Text.RegularExpressions.Regex.Match(CasparCGPortTextBox.Text, @"^\d+$").Success) {
         MessageBox.Show("Please enter a valid port. Default is 5250", "Invalid port", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         e.Cancel = true;
     }
 }
Example #22
0
 protected override void OnTerminating(CancelEventArgs e)
 {
     base.OnTerminating (e);
     var form = this.MainForm as MainForm;
     if (!form.PromptSave ())
         e.Cancel = true;
 }
Example #23
0
		protected override void OnClosing(CancelEventArgs e)
		{
			if (_connector != null)
				_connector.Dispose();

			base.OnClosing(e);
		}
Example #24
0
 protected override void OnClosing(CancelEventArgs e)
 {
     App.MainController.Logout(() =>
     {
         base.OnClosing(e);
     });
 }
Example #25
0
        private void openKeyFileDialog_FileOk(object sender, CancelEventArgs e)
        {
            BIFTreeView.Nodes.Clear();

            try
            {

                pathContext = Path.GetDirectoryName(openKeyFileDialog.FileName) + "\\";
                String modName = Path.GetFileName(openKeyFileDialog.FileName);
                BIF_KEY tannen = new BIF_KEY(pathContext + modName);

                foreach (BIF_FILETABLE_ENTRY file in tannen.FILETABLE)
                {
                    TreeNode BIFLevelNode = new TreeNode(file.BIFName);

                    foreach (BIF_KEYTABLE_ENTRY key in file.ownedResources)
                    {
                        TreeNode ResourceLevelNode = new TreeNode(BIF_Utility.makeNewResName(key.ResourceName, key.ResourceType));
                        ResourceLevelNode.Tag = key;
                        BIFLevelNode.Nodes.Add(ResourceLevelNode);
                    }
                    BIFTreeView.Nodes.Add(BIFLevelNode);
                }
            }
            catch (FileNotFoundException ee)
            {
                MessageBox.Show("There was a problem reading the BIF index (KEY) file: \r\n"
                    + ee.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 protected override void OnClosing( CancelEventArgs e )
 {
     if ( !e.Cancel ) {
     CommandRunner.Instance.TopProcessKill ( );
       }
       base.OnClosing ( e );
 }
Example #27
0
		private void HistoricViewer_OnClosing (object Sender, CancelEventArgs E)
			{
			foreach (ResultViewer OpenResult in ListOfOpenResultViewer)
				{
				OpenResult.DoFinalClose ();
				}
			}
Example #28
0
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            base.OnBackKeyPress(e);

            if (!e.Cancel && !ConfirmNavigateAway())
                e.Cancel = true;
        }
 protected override void OnClosing(CancelEventArgs e)
 {
     e.Cancel = !_DoClose;
     base.OnClosing(e);
     Program.Status.VideoScreenVisible = false;
     Hide();
 }
 protected override void OnClosing(CancelEventArgs e)
 {
     if (m_vm != null)
     {
         AlphaClient.Instance.Release(m_vm);
     }
 }
Example #31
0
 protected override void OnClosing(CancelEventArgs e)
 {
     DeregisterContentEvents();
     Application.DoEvents();
     base.OnClosing(e);
 }
 private void extractorDefaultActionCombo_Validating(object sender, CancelEventArgs e)
 {
     this.GetSelectedItem().DefaultAction = (MessageContentExtractorAction)this.extractorDefaultActionCombo.SelectedValue;
 }
Example #33
0
        private void OnClosing(object sender, CancelEventArgs e)
        {
            MusicUnframed mu = DataContext as MusicUnframed;

            mu.Save();
        }
Example #34
0
 private void OpenFileDialogCSS_FileOk(object sender, CancelEventArgs e)
 {
     StyleSheet = File.ReadAllText(openFileDialogCSS.FileName);
     ToolStripButtonRefresh_Click(sender, e);
 }
Example #35
0
 private void SaveFileDialogExport_FileOk(object sender, CancelEventArgs e)
 {
     File.WriteAllText(saveFileDialogExport.FileName, webBrowserMarkdownPreview.DocumentText);
 }
 private void Form_Closing(object sender, CancelEventArgs e)
 => DoOnFormClosing(e);
        //private void btnViewReport_Click(object sender, EventArgs e)
        //{

        //    ViewReport();
        //}

        private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
        }
Example #38
0
 private void ctxMenu1_Opening(object sender, CancelEventArgs e)
 {
     ctxMenuRemove.Enabled               = ctxMenuOpen.Enabled = ctxMenuSaveSelected.Enabled = ctxMenuProperties.Enabled = listBox1.SelectedIndex >= 0;
     ctxMenuRemoveAll.Enabled            = ctxMenuSave.Enabled = listBox1.Items.Count > 0;
     ctxMenuRemoveAllButSelected.Enabled = listBox1.Items.Count > 1;
 }
Example #39
0
 protected virtual void OnClosing(CancelEventArgs e)
 {
     Closing?.Invoke(this, e);
 }
Example #40
0
 static void OnConsoleClosing(object sender, CancelEventArgs e)
 {
     // Dispose the client component.
     m_serviceClient.Dispose();
 }
Example #41
0
 protected void rvBudgetEntry_ReportRefresh(object sender, CancelEventArgs e)
 {
     btnViewReport_Click(null, null);
 }
Example #42
0
 private void asset_Closing(object sender, CancelEventArgs e)
 {
     API_Unregister();
     Application.Exit();
 }
Example #43
0
        private async void Window_Closing(object sender, CancelEventArgs e)
        {
            try
            {
                Log.Info("Shutting down...");
                Influx.OnAppExit(Helper.GetCurrentVersion());
                Core.UpdateOverlay = false;
                Core.Update        = false;

                //wait for update to finish, might otherwise crash when overlay gets disposed
                for (var i = 0; i < 100; i++)
                {
                    if (Core.CanShutdown)
                    {
                        break;
                    }
                    await Task.Delay(50);
                }

                Config.Instance.SelectedTags = Config.Instance.SelectedTags.Distinct().ToList();
                //Config.Instance.ShowAllDecks = DeckPickerList.ShowAll;
                Config.Instance.SelectedDeckPickerClasses = DeckPickerList.SelectedClasses.ToArray();

                Config.Instance.WindowWidth       = (int)(Width - (GridNewDeck.Visibility == Visible ? GridNewDeck.ActualWidth : 0));
                Config.Instance.WindowHeight      = (int)(Height - _heightChangeDueToSearchBox);
                Config.Instance.TrackerWindowTop  = (int)Top;
                Config.Instance.TrackerWindowLeft = (int)(Left + (MovedLeft ?? 0));

                //position of add. windows is NaN if they were never opened.
                if (!double.IsNaN(Core.Windows.PlayerWindow.Left))
                {
                    Config.Instance.PlayerWindowLeft = (int)Core.Windows.PlayerWindow.Left;
                }
                if (!double.IsNaN(Core.Windows.PlayerWindow.Top))
                {
                    Config.Instance.PlayerWindowTop = (int)Core.Windows.PlayerWindow.Top;
                }
                Config.Instance.PlayerWindowHeight = (int)Core.Windows.PlayerWindow.Height;

                if (!double.IsNaN(Core.Windows.OpponentWindow.Left))
                {
                    Config.Instance.OpponentWindowLeft = (int)Core.Windows.OpponentWindow.Left;
                }
                if (!double.IsNaN(Core.Windows.OpponentWindow.Top))
                {
                    Config.Instance.OpponentWindowTop = (int)Core.Windows.OpponentWindow.Top;
                }
                Config.Instance.OpponentWindowHeight = (int)Core.Windows.OpponentWindow.Height;

                if (!double.IsNaN(Core.Windows.TimerWindow.Left))
                {
                    Config.Instance.TimerWindowLeft = (int)Core.Windows.TimerWindow.Left;
                }
                if (!double.IsNaN(Core.Windows.TimerWindow.Top))
                {
                    Config.Instance.TimerWindowTop = (int)Core.Windows.TimerWindow.Top;
                }
                Config.Instance.TimerWindowHeight = (int)Core.Windows.TimerWindow.Height;
                Config.Instance.TimerWindowWidth  = (int)Core.Windows.TimerWindow.Width;

                Core.TrayIcon.NotifyIcon.Visible = false;
                Core.Overlay.Close();
                await Core.StopLogWacher();

                Core.Windows.TimerWindow.Shutdown();
                Core.Windows.PlayerWindow.Shutdown();
                Core.Windows.OpponentWindow.Shutdown();
                Config.Save();
                DeckList.Save();
                DeckStatsList.Save();
                PluginManager.SavePluginsSettings();
                PluginManager.Instance.UnloadPlugins();
            }
            catch (Exception)
            {
                //doesnt matter
            }
            finally
            {
                Application.Current.Shutdown();
            }
        }
Example #44
0
 private void MainWindow_OnClosing(object sender, CancelEventArgs e)
 {
     _eplanOffline.Close();
     _preview.Dispose();
 }
Example #45
0
 private void WebBrowserControl_Validating(object sender, CancelEventArgs e)
 {
     this.OnValidating(e);
 }
Example #46
0
 private void UsernameValidating(object sender, CancelEventArgs e)
 {
     var tb = sender as TextBox;
 }
Example #47
0
 private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
 {
 }
 private void MetroWindow_Closing(object sender, CancelEventArgs e) => closing = true;
Example #49
0
 private void Form1_Validating(object sender, CancelEventArgs e)
 {
     ConsoleWrite(serialConsoleRtb, message);
 }
Example #50
0
 private void WebBrowserControl_NewWindow(object sender, CancelEventArgs e)
 {
     this.OnNewWindow(e);
 }
Example #51
0
        /// <summary>
        /// Override windows message loop handling.
        /// </summary>
        /// <param name="m">The Windows <see cref="T:System.Windows.Forms.Message"/> to process.</param>
        protected override void WndProc(ref Message m)
        {
            long wparam = m.WParam.ToInt64();

            switch (m.Msg)
            {
            case Win32Native.WM_SIZE:
                if (wparam == SIZE_MINIMIZED)
                {
                    previousWindowState = FormWindowState.Minimized;
                    OnPauseRendering(EventArgs.Empty);
                }
                else
                {
                    Rectangle rect;

                    GetClientRect(m.HWnd, out rect);
                    if (rect.Bottom - rect.Top == 0)
                    {
                        // Rapidly clicking the task bar to minimize and restore a window
                        // can cause a WM_SIZE message with SIZE_RESTORED when
                        // the window has actually become minimized due to rapid change
                        // so just ignore this message
                    }
                    else if (wparam == SIZE_MAXIMIZED)
                    {
                        if (previousWindowState == FormWindowState.Minimized)
                        {
                            OnResumeRendering(EventArgs.Empty);
                        }

                        previousWindowState = FormWindowState.Maximized;

                        OnUserResized(EventArgs.Empty);
                        cachedSize = Size;
                    }
                    else if (wparam == SIZE_RESTORED)
                    {
                        if (previousWindowState == FormWindowState.Minimized)
                        {
                            OnResumeRendering(EventArgs.Empty);
                        }

                        if (!isUserResizing && (Size != cachedSize || previousWindowState == FormWindowState.Maximized))
                        {
                            previousWindowState = FormWindowState.Normal;

                            // Only update when cachedSize is != 0
                            if (cachedSize != Size.Empty)
                            {
                                isSizeChangedWithoutResizeBegin = true;
                            }
                        }

                        previousWindowState = FormWindowState.Normal;
                    }
                }
                break;

            case Win32Native.WM_ACTIVATEAPP:
                if (wparam != 0)
                {
                    OnAppActivated(EventArgs.Empty);
                }
                else
                {
                    OnAppDeactivated(EventArgs.Empty);
                }
                break;

            case Win32Native.WM_POWERBROADCAST:
                if (wparam == PBT_APMQUERYSUSPEND)
                {
                    OnSystemSuspend(EventArgs.Empty);
                    m.Result = new IntPtr(1);
                    return;
                }
                if (wparam == PBT_APMRESUMESUSPEND)
                {
                    OnSystemResume(EventArgs.Empty);
                    m.Result = new IntPtr(1);
                    return;
                }
                break;

            case Win32Native.WM_MENUCHAR:
                //m.Result = new IntPtr(MNC_CLOSE << 16); // IntPtr(MAKELRESULT(0, MNC_CLOSE));
                return;

            case Win32Native.WM_SYSCOMMAND:
                wparam &= 0xFFF0;
                if (wparam == SC_MONITORPOWER || wparam == SC_SCREENSAVE)
                {
                    var e = new CancelEventArgs();
                    OnScreensaver(e);
                    if (e.Cancel)
                    {
                        m.Result = IntPtr.Zero;
                        return;
                    }
                }
                break;

            case Win32Native.WM_SYSKEYDOWN:     //alt is down
                if (wparam == VK_RETURN)
                {
                    if (!EnableFullscreenToggle)
                    {
                        return;
                    }
                    OnFullscreenToggle(new EventArgs());     //we handle alt enter manually
                }
                break;
            }
            base.WndProc(ref m);
        }
Example #52
0
 private void ThisWindow_Closing(object sender, CancelEventArgs e)
 {
     StopOnlineView();
 }
Example #53
0
 private void ruleListMenuStrip_Opening(object sender, CancelEventArgs e)
 {
     deleteToolStripMenuItem.Enabled = (ruleListView.SelectedIndices.Count > 0);
 }
Example #54
0
 private void comPresentLb_Validating(object sender, CancelEventArgs e)
 {
 }
Example #55
0
 protected override void OnClosing(CancelEventArgs e)
 {
     base.OnClosing(e);
     e.Cancel = true;
     Hide();
 }
Example #56
0
 /// <summary>
 /// Raises the <see cref="E:Screensaver"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.</param>
 private void OnScreensaver(CancelEventArgs e)
 {
     Screensaver?.Invoke(this, e);
 }
Example #57
0
 private void txtPassword_Validating(object sender, CancelEventArgs e)
 {
 }
 /// <summary>
 /// Raises the Closing event on the provider.
 /// </summary>
 /// <param name="cea">A CancelEventArgs containing the event data.</param>
 public void Closing(CancelEventArgs cea)
 {
     _provider.OnClosing(cea);
 }
Example #59
0
 private void saveFileDialogOut_FileOk(object sender, CancelEventArgs e)
 {
     tbOutFileName.Text = saveFileDialogOut.FileName;
     outFileContainer   = new FileContainer(saveFileDialogOut.FileName);
 }
Example #60
0
 private void _txtStartPage_Validating(object sender, CancelEventArgs e)
 {
     CommitPageNumber();
 }