• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CancelEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CancelEventArgs的典型用法代码示例。如果您正苦于以下问题:C# CancelEventArgs类的具体用法?C# CancelEventArgs怎么用?C# CancelEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CancelEventArgs类属于命名空间,在下文中一共展示了CancelEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ctxObjects_Opening

 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;
     }
   }
 }
开发者ID:smther,项目名称:FreeOQ,代码行数:28,代码来源:DataSeriesViewer.cs


示例2: mainWindow_Closing

        // 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;
                }
            }
        }
开发者ID:ClemensT,项目名称:WPF-Samples,代码行数:30,代码来源:MainWindow.cs


示例3: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     string json = _jsonSerializer.Serialize(_storageAccountConnections);
     File.WriteAllText(SettingsFilePath, json);
     _deploymentConfigFileWatcher.Dispose();
     base.OnClosing(e);
 }
开发者ID:Microsoft,项目名称:Yams,代码行数:7,代码来源:MainWindow.xaml.cs


示例4: ValidateTextBox

        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;
        }
开发者ID:ericzhc,项目名称:gprs-system-tiger,代码行数:31,代码来源:FLogin.cs


示例5: openFileDialog1_FileOk

 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";
     }
 }
开发者ID:kleitz,项目名称:statstron,代码行数:34,代码来源:FileIgraci.cs


示例6: OnClosing

        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;
        }
开发者ID:ashokgelal,项目名称:inSSIDer-2,代码行数:33,代码来源:frmLogConverter.cs


示例7: OnClosing

		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);
		}
开发者ID:carlosaduro,项目名称:StockSharp,代码行数:25,代码来源:SynchronizeWindow.xaml.cs


示例8: OnClosing

		protected override void OnClosing(CancelEventArgs e)
		{
			if (_connector != null)
				_connector.Dispose();

			base.OnClosing(e);
		}
开发者ID:jackman0925,项目名称:StockSharp,代码行数:7,代码来源:MainWindow.xaml.cs


示例9: OnBackKeyPress

        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            base.OnBackKeyPress(e);

            if (!e.Cancel && !ConfirmNavigateAway())
                e.Cancel = true;
        }
开发者ID:nthobois,项目名称:7Pass,代码行数:7,代码来源:EntryDetails.xaml.cs


示例10: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     App.MainController.Logout(() =>
     {
         base.OnClosing(e);
     });
 }
开发者ID:kalantyr,项目名称:Parallel,代码行数:7,代码来源:MainWindow.xaml.cs


示例11: openKeyFileDialog_FileOk

        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);
            }
        }
开发者ID:returns-null,项目名称:GeraltOfBIFFia,代码行数:30,代码来源:BIFTool.cs


示例12: HistoricViewer_OnClosing

		private void HistoricViewer_OnClosing (object Sender, CancelEventArgs E)
			{
			foreach (ResultViewer OpenResult in ListOfOpenResultViewer)
				{
				OpenResult.DoFinalClose ();
				}
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:7,代码来源:HistoricViewer.xaml.cs


示例13: OnClosing

 protected override void OnClosing( CancelEventArgs e )
 {
     if ( !e.Cancel ) {
     CommandRunner.Instance.TopProcessKill ( );
       }
       base.OnClosing ( e );
 }
开发者ID:camalot,项目名称:droidexplorer,代码行数:7,代码来源:ProcessViewerForm.cs


示例14: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     e.Cancel = !_DoClose;
     base.OnClosing(e);
     Program.Status.VideoScreenVisible = false;
     Hide();
 }
开发者ID:OpenJinglePlayer,项目名称:OpenJinglePlayer,代码行数:7,代码来源:VideoWindow.cs


示例15: Window_OnClosing

 private void Window_OnClosing(object sender, CancelEventArgs e)
 {
     var vm = (FocusTrackerToolWindowViewModel)this.DataContext;
     vm.Remove();
     //((ToolWindow)sender).Hide();
     //e.Cancel = true;
 }
开发者ID:Robotonics,项目名称:AllJoyn-Weahter-station,代码行数:7,代码来源:FocusTrackerWindow.xaml.cs


示例16: OnTerminating

 protected override void OnTerminating(CancelEventArgs e)
 {
     base.OnTerminating (e);
     var form = this.MainForm as MainForm;
     if (!form.PromptSave ())
         e.Cancel = true;
 }
开发者ID:andererandre,项目名称:Notedown,代码行数:7,代码来源:Program.cs


示例17: OnFilterExpressionBuilding

        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();
        }
开发者ID:sgissinger,项目名称:DataGridView-Filter-Popup-Extensions,代码行数:31,代码来源:CustomizedColumnFilter.cs


示例18: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     if (m_vm != null)
     {
         AlphaClient.Instance.Release(m_vm);
     }
 }
开发者ID:Foxbow74,项目名称:x-transport,代码行数:7,代码来源:AlphaRootTool.xaml.cs


示例19: maskedTextBoxDateFin_Validating

        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");
            }

        }
开发者ID:MrStamina,项目名称:FirstProjectAfpaServices,代码行数:28,代码来源:ProjetAuForfait.cs


示例20: contextMenu_Opening

        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);
                }
            }
        }
开发者ID:diadorkin,项目名称:JiraSVN,代码行数:26,代码来源:IssuesList.cs



注:本文中的CancelEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CancelTrackerClass类代码示例发布时间:2022-05-24
下一篇:
C# CanRunDecoratorDelegate类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap