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

C# ComponentModel.CancelEventArgs类代码示例

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

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



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

示例1: Window_Closing

        private void Window_Closing(object sender, CancelEventArgs e)
        {
            var model = (MusicViewModel) DataContext;
            model.SaveIfDirty();

            SaveSettings();
        }
开发者ID:dmacuk,项目名称:MusicPicker,代码行数:7,代码来源:MainWindow.xaml.cs


示例2: textBox_Validating

 private void textBox_Validating(object sender, CancelEventArgs e) {
   var textBox = (TextBox)sender;
   decimal value = 0;
   if (allowOnlyInteger) {
     int intValue;
     if (!int.TryParse(textBox.Text, out intValue)) {
       errorProvider.SetError(textBox, "Please enter a valid integer value.");
       e.Cancel = true;
       return;
     } else {
       value = intValue;
       errorProvider.SetError(textBox, null);
     }
   } else {
     if (!decimal.TryParse(textBox.Text, NumberStyles.Float, CultureInfo.CurrentCulture.NumberFormat, out value)) {
       errorProvider.SetError(textBox, "Please enter a valid double value.");
       e.Cancel = true;
       return;
     } else errorProvider.SetError(textBox, null);
   }
   if (textBox == minimumTextBox) Minimum = value;
   else if (textBox == maximumTextBox) Maximum = value;
   else if (textBox == stepSizeTextBox) Step = value;
   okButton.Enabled = IsValid();
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:25,代码来源:DefineArithmeticProgressionDialog.cs


示例3: Close

 private void Close(object sender, CancelEventArgs e)
 {
     if (_kinectSensor != null)
     {
         _kinectSensor.Close();
     }
 }
开发者ID:franklinNCAT,项目名称:KinectPulseMonitor,代码行数:7,代码来源:MainWindow.xaml.cs


示例4: OnClosing

 private void OnClosing(object sender, CancelEventArgs e)
 {
     if (!App.Locator.MainWindow.IsAuth)
     {
         this.Close();
     }
 }
开发者ID:AndrewNikolin,项目名称:vk-export,代码行数:7,代码来源:MainWindow.xaml.cs


示例5: WindowClosing

 private void WindowClosing(object sender, CancelEventArgs e)
 {
     if(!Validate())
     {
         e.Cancel = true;
     }
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:7,代码来源:GetStringValueWindow.xaml.cs


示例6: Window_OnClosing

 private void Window_OnClosing(object sender, CancelEventArgs e)
 {
     var vm = (ElementListToolWindowViewModel)this.DataContext;
     vm.Remove();
     //((ToolWindow)sender).Hide();
     //e.Cancel = true;
 }
开发者ID:siatwangmin,项目名称:WinRTXamlToolkit,代码行数:7,代码来源:ElementListWindow.xaml.cs


示例7: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     RegisterOprate.SaveRegData(KeyName, tabs.SelectedIndex);
     if (MessageBox.Show("确认退出?", "请确认", MessageBoxButtons.YesNo) == DialogResult.No)
         e.Cancel = true;
     base.OnClosing(e);
 }
开发者ID:dalinhuang,项目名称:shool-card,代码行数:7,代码来源:Library.cs


示例8: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     if (null == mDockUrl)
     {
         e.Cancel = false;
     }
     else if (mDockUrl._isDirty())
     {
         string dockUrlName_ = mDockUrl._getDockUrlName();
         if (null == dockUrlName_ || "" == dockUrlName_)
         {
             dockUrlName_ = "untitle";
         }
         DialogResult dialogResult_ = MessageBox.Show("是否保存?", dockUrlName_, MessageBoxButtons.OKCancel);
         if (dialogResult_ == DialogResult.OK)
         {
             mDockUrl._runSave();
             mDockUrl._runClose();
             e.Cancel = false;
         }
         else
         {
             e.Cancel = true;
         }
     }
     else
     {
         mDockUrl._runClose();
         e.Cancel = false;
     }
     base.OnClosing(e);
 }
开发者ID:zyouhua,项目名称:weilai,代码行数:32,代码来源:DockFrame.cs


示例9: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     base.OnClosing(e);
     e.Cancel = true;
     Hide();
     formControl.buttonShowGraph.Text = "Показать график";
 }
开发者ID:EmbeddedSystem,项目名称:Regis_CSharp,代码行数:7,代码来源:FormGraph.cs


示例10: MainWindowClosing

        /// <summary> Shuts down the application when the main window closes. </summary>
        /// <param name="sender"> The sender.  </param>
        /// <param name="e"> The event arguments.  </param>
        private void MainWindowClosing(object sender, CancelEventArgs e)
        {
            var vm = (MainWindowViewModel)this.DataContext;
            vm.SaveSettings();

            Application.Current.Shutdown();
        }
开发者ID:ascendedguard,项目名称:starboard-dota2,代码行数:10,代码来源:MainWindowView.xaml.cs


示例11: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     //Prevent disposal of dialog
     e.Cancel = true;
     base.OnClosing(e);
     Hide();
 }
开发者ID:crazymouse0,项目名称:SharperGps,代码行数:7,代码来源:FrmGpsSettings.cs


示例12: OnClosing

        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);
            if (checkBox1.Checked)
            {
                // User clicked 'ignore': set flag in VM.
                log.DebugFormat("Setting IgnoreExcessiveVcpus flag to true for VM {0}", vm.Name);

                VM copyVM = (VM)vm.Clone();
                copyVM.IgnoreExcessiveVcpus = true;
                // Save changes to server
                try
                {
                    vm.Locked = true;
                    copyVM.SaveChanges(vm.Connection.Session);
                }
                finally
                {
                    vm.Locked = false;
                }
            }
            else
            {
                // Select VM's settings (a.k.a. 'general') tab
                if (Program.MainWindow.SelectObject(this.vm))
                    Program.MainWindow.SwitchToTab(MainWindow.Tab.Settings);
            }
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:28,代码来源:VcpuWarningDialog.cs


示例13: MammaView_OnClosing

 private void MammaView_OnClosing(object sender, CancelEventArgs e)
 {
     var viewModel = DataContext as MammaViewModel;
     if (viewModel != null && viewModel.SaveCommand.CanExecute(null))
     {
         var dialogResult = MessageBox.Show("Есть несохраненные изменения. Сохранить их?", "УЗД молочной железы",
             MessageBoxButton.YesNoCancel, MessageBoxImage.Question, MessageBoxResult.Yes);
         switch (dialogResult)
         {
             case MessageBoxResult.Yes:
                 viewModel.SaveCommand.Execute(null);
                 break;
             case MessageBoxResult.Cancel:
                 e.Cancel = true;
                 break;
         }
     }
     else
     {
         var dialogResult = MessageBox.Show("Вы уверны, что хотите выйти?", "УЗД молочной железы",
             MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes);
         if (dialogResult == MessageBoxResult.No)
         {
             e.Cancel = true;
         }
     }
 }
开发者ID:burukinsd,项目名称:USD,代码行数:27,代码来源:MammaView.xaml.cs


示例14: OnNotInList

 protected virtual void OnNotInList(CancelEventArgs e)
 {
     if (NotInList != null)
     {
         NotInList(this, e);
     }
 }
开发者ID:burritowarrior,项目名称:EFDemo,代码行数:7,代码来源:AutoCompleteComboBox.cs


示例15: OnLogConsoleWindowClosing

 void OnLogConsoleWindowClosing( object sender, CancelEventArgs e )
 {
     e.Cancel = true;
     _logConsoleWindow.Visibility = System.Windows.Visibility.Collapsed;
     _consoleWindowIsClosed = true;
     OnPropertyChanged( "IsMaximized" );
 }
开发者ID:Invenietis,项目名称:ck-certified,代码行数:7,代码来源:VMLogOutputContainer.cs


示例16: OnParentClosing

        private void OnParentClosing(object sender, CancelEventArgs e)
        {
            e.Cancel = true;

            if (Command != null && Command.CanExecute(CommandParameter))
                Command.Execute(CommandParameter);
        }
开发者ID:systemmetaphor,项目名称:BlueDwarf,代码行数:7,代码来源:CloseButton.cs


示例17: AttributeArgumentEditor_Validating

		private void AttributeArgumentEditor_Validating(object sender, CancelEventArgs e)
		{
			var validated = false;

			if (AttributeArgumentEditor.TypeReferenceEditor.SelectedOperand != null)
			{
				var arg = AttributeArgumentEditor.SelectedArgument;
				if (arg.Type is TypeSpecification)
				{
					var tspec = arg.Type as TypeSpecification;
					validated = tspec.ElementType != null;
				}
				else
					validated = true;
			}

			if (!validated)
			{
				ErrorProvider.SetError(AttributeArgumentEditor, "Type is mandatory");
				e.Cancel = true;
			}
			else
			{
				ErrorProvider.SetError(AttributeArgumentEditor, string.Empty);
			}
		}
开发者ID:XQuantumForceX,项目名称:Reflexil,代码行数:26,代码来源:CustomAttributeArgumentForm.cs


示例18: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     if (_dontShowAgainCheckbox.Checked) {
         JToolsPackage.Instance.OptionsPage.PromptBeforeRunningWithBuildError = false;
         JToolsPackage.Instance.OptionsPage.SaveSettingsToStorage();
     }
 }
开发者ID:borota,项目名称:JTVS,代码行数:7,代码来源:StartWithErrorsDialog.cs


示例19: OnClosing

 protected override void OnClosing(CancelEventArgs e)
 {
     if (MessageBox.Show("确认退出?", "请确认", MessageBoxButtons.YesNo) == DialogResult.No)
         e.Cancel = true;
     SaveRegConfig();
     base.OnClosing(e);
 }
开发者ID:dalinhuang,项目名称:shool-card,代码行数:7,代码来源:restaurant.cs


示例20: OnClosing

		protected override void OnClosing(CancelEventArgs e)
		{
			if(_appIsClosing)
				return;
			e.Cancel = true;
			Hide();
		}
开发者ID:christopher7694,项目名称:Hearthstone-Deck-Tracker,代码行数:7,代码来源:StatsWindow.xaml.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ComponentModel.CollectionChangeEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# ComponentModel.BackgroundWorker类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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