public MWindow() { try { InitializeComponent(); Closing += new CancelEventHandler(MWindow_Closing); worker.DoWork += new DoWorkEventHandler(worker_DoWork); worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); dt.Interval = TimeSpan.FromSeconds(1); dt.Tick += new EventHandler(dt_Tick); foldingManager = FoldingManager.Install(textEditor.TextArea); foldingStrategy = new XmlFoldingStrategy(); textEditor.TextChanged += new EventHandler(textEditor_TextChanged); if (App.StartUpCommand != "" && App.StartUpCommand != null) { openFile(App.StartUpCommand); } KeyGesture renderKeyGesture = new KeyGesture(Key.F5); KeyBinding renderCmdKeybinding = new KeyBinding(Commands.Render, renderKeyGesture); this.InputBindings.Add(renderCmdKeybinding); status.Text = "Ready!"; } catch (Exception e) { MessageBox.Show(e.Message); } }
public MainWindow() { InitializeComponent(); //GMapProvider.WebProxy = WebRequest.DefaultWebProxy; // or //GMapProvider.WebProxy = new WebProxy("127.0.0.1", 1080); //GMapProvider.IsSocksProxy = true; GMaps.Instance.EnableTileHost(8844); Closing += new CancelEventHandler(MainWindow_Closing); // The pushpin to add to the map. Pushpin pin = new Pushpin(); { pin.Location = map.Center; pin.ToolTip = new Label() { Content = "GMap.NET fusion power! ;}" }; } map.Children.Add(pin); }
public MainWindow() { InitializeComponent(); btnStartCapture = StartCapture; ToggleCaptureBtn(true); gridEmailGroup = EmailGrouping; ToggleEmailGrouping(false); ToggleTakePhotoLabel(true); ToggleSetupTimer(false); _CountDownTimer.Tick += new EventHandler(CountDown_Tick); _CountDownTimer.Interval = new TimeSpan(0, 0, 1); Closing += new CancelEventHandler(this.KillLiveViewOnClose); if (!Directory.Exists(imageDirectory)) { Directory.CreateDirectory(imageDirectory); Directory.CreateDirectory(imageDirectory + @"\CSV\"); } if (!File.Exists(userEmailsCSV)) { string csvHeader = "E-Mail" + "," + "Photo"; File.WriteAllText(userEmailsCSV, csvHeader); } }
public void Init() { dgvColumns.AutoGenerateColumns = false; lstTable.SelectedIndexChanged +=new EventHandler(lstTable_SelectedIndexChanged); string connStr = GetConnStr(); BindDatabaseData(connStr); Closing += new CancelEventHandler(Main_Closing); CodeEntityParameter entParam = CodeEntityParameter.Get(); rbtnAddPrefix.Checked = entParam.IsAddOrRemovePrefix; rbtnRemovePrefix.Checked = !entParam.IsAddOrRemovePrefix; rbtnAddPrefix.Checked = entParam.IsAddOrRemovePrefix; chkSuffix.Checked = entParam.IsAddSuffix; txtNameSpace.Text = entParam.NameSpace; txtPrefix.Text = entParam.Prefix; txtSuffix.Text = entParam.Suffix; txtSuffix.Enabled = entParam.IsAddSuffix; txtSavePath.Text = entParam.SavePath; txtServer.Text = entParam.Server; txtUser.Text = entParam.UserId; txtPwd.Text = entParam.UserPwd; rbtnMSSQL.Checked = !entParam.IntegratedSecurity; rbtnWindows.Checked = entParam.IntegratedSecurity; cboDatabase.Text = entParam.DataBaseName ?? cboDatabase.Text; }
public MainWindow() { InitializeComponent(); Hide(); Closing += new CancelEventHandler(MainWindow_Closing); updateUi(); }
public override void Run() { TaskManager mgr = ServiceManager.Instance.GetService<TaskManager>(); string name = Workbench.Instance.ObjectExplorer.GetSelectedNode().Name; EtlProcess proc = mgr.GetTask(name); FdoBulkCopy bcp = proc as FdoBulkCopy; CancelEventHandler ch = new CancelEventHandler(OnBeforeExecuteBulkCopy); if (bcp != null) { bcp.BeforeExecute += ch; } if (proc != null) { IFdoSpecializedEtlProcess spec = proc as IFdoSpecializedEtlProcess; if (spec != null) { EtlProcessCtl ctl = new EtlProcessCtl(spec); Workbench.Instance.ShowContent(ctl, ViewRegion.Dialog); if (bcp != null) { bcp.BeforeExecute -= ch; } } else { MessageService.ShowError(ResourceService.GetString("ERR_CANNOT_EXECUTE_UNSPECIALIZED_ETL_PROCESS")); } } }
private void InitializeDialog(CodeExpression expression) { HelpRequested += new HelpEventHandler(OnHelpRequested); HelpButtonClicked += new CancelEventHandler(OnHelpClicked); if (expression != null) { this.ruleExpressionCondition.Expression = RuleExpressionWalker.Clone(expression); this.conditionTextBox.Text = ruleExpressionCondition.ToString().Replace("\n", "\r\n"); } else this.conditionTextBox.Text = string.Empty; this.conditionTextBox.PopulateAutoCompleteList += new EventHandler<AutoCompletionEventArgs>(ConditionTextBox_PopulateAutoCompleteList); this.conditionTextBox.PopulateToolTipList += new EventHandler<AutoCompletionEventArgs>(ConditionTextBox_PopulateAutoCompleteList); try { this.ruleParser.ParseCondition(this.conditionTextBox.Text); conditionErrorProvider.SetError(this.conditionTextBox, string.Empty); } catch (RuleSyntaxException ex) { conditionErrorProvider.SetError(this.conditionTextBox, ex.Message); } }
protected BasicBrowserDialog(Activity activity, string name) { if (activity == null) throw (new ArgumentNullException("activity")); this.activity = activity; InitializeComponent(); // set captions this.descriptionLabel.Text = DescriptionText; this.Text = TitleText; this.previewLabel.Text = PreviewLabelText; this.newRuleToolStripButton.Enabled = true; this.name = name; serviceProvider = activity.Site; //Set dialog fonts IUIService uisvc = (IUIService)activity.Site.GetService(typeof(IUIService)); if (uisvc != null) this.Font = (Font)uisvc.Styles["DialogFont"]; HelpRequested += new HelpEventHandler(OnHelpRequested); HelpButtonClicked += new CancelEventHandler(OnHelpClicked); this.rulesListView.Select(); }
public MafiaVideo(Form form, bool fullscreen) { this.form = form; this.fullscreen = fullscreen; if (fullscreen) { form.FormBorderStyle = FormBorderStyle.None; } else { form.FormBorderStyle = FormBorderStyle.Sizable; } try { device = new Device(0, DeviceType.Hardware, form, CreateFlags.HardwareVertexProcessing, GetDefaultPresentParameters(fullscreen)); } catch (InvalidCallException) { try { device = new Device(0, DeviceType.Hardware, form, CreateFlags.SoftwareVertexProcessing, GetDefaultPresentParameters(fullscreen)); } catch (InvalidCallException) { try { device = new Device(0, DeviceType.Software, form, CreateFlags.SoftwareVertexProcessing, GetDefaultPresentParameters(fullscreen)); } catch (InvalidCallException) { throw new Exception("Direct3Dデバイスの生成に失敗しました。"); } } } deviceLost = new EventHandler(OnDeviceLost); deviceReset = new EventHandler(OnDeviceReset); deviceResizing = new CancelEventHandler(OnDeviceResizing); device.DeviceLost += deviceLost; device.DeviceReset += deviceReset; device.DeviceResizing += deviceResizing; device.Clear(ClearFlags.Target, Color.FromArgb(212, 208, 200), 0.0f, 0); sprite = new Sprite(device); backBuffer = device.GetBackBuffer(0, 0, BackBufferType.Mono); offScreenImage = new Texture(device, Mafia.SCREEN_WIDTH, Mafia.SCREEN_HEIGHT, 1, Usage.RenderTarget, Manager.Adapters[0].CurrentDisplayMode.Format, Pool.Default); offScreenSurface = offScreenImage.GetSurfaceLevel(0); texture = MafiaLoader.DefaultLoader.GetTexture(device, "mafia.bmp"); if (fullscreen) { Cursor.Hide(); } // form.ClientSize = new Size(Mafia.SCREEN_WIDTH, Mafia.SCREEN_HEIGHT); form.ClientSize = new Size(Mafia.SCREEN_WIDTH * 2, Mafia.SCREEN_HEIGHT * 2); }
public MainWindow() { InitializeComponent(); if(Title == null) { Title = AppDomain.CurrentDomain.FriendlyName; } _viewModel = DataContext as Browser; SlideUpStoryboard = (Storyboard)TryFindResource("SlideUpStoryboard"); SlideDownStoryboard = (Storyboard)TryFindResource("SlideDownStoryboard"); SlideUpAnimation = (DoubleAnimation)SlideUpStoryboard.Children.First(); SlideDownAnimation = (DoubleAnimation)SlideDownStoryboard.Children.First(); Closing += new CancelEventHandler(delegate (object sender, CancelEventArgs e) { if(!AllowFormClose) { e.Cancel = true; } SlideDown(); }); System.Windows.Application.Current.Exit += Current_Exit; SlideDownAnimation.Completed += new EventHandler(delegate (object o, EventArgs e) { Hide(); }); }
private CancelEventHandler CreateHandler() { var handler = new CancelEventHandler(_mockEmailProcessor.Object) { ObjectContextFactory = _objectContextFactory }; return handler; }
public set() { InitializeComponent(); Closing += new CancelEventHandler(set_Closing); this.ControlBox = false; textBox1.KeyPress += new KeyPressEventHandler(textBox1_KeyPress); //textBox2.KeyPress += new KeyPressEventHandler(textBox1_KeyPress); }
public Form1() { InitializeComponent(); Directory.SetCurrentDirectory(dir); Load += new EventHandler(Form1_Load); Closing += new CancelEventHandler(Form1_Closing); textBox1.KeyDown += new KeyEventHandler(textBox1_KeyDown); textBox1.KeyUp += new KeyEventHandler(textBox1_KeyUp); }
public SplashScreen() { InitializeComponent(); LanguageLoader.LoadLanguage(); Title = GlobalData.AppName; GameLauncher.GameExitHandler += new EventHandler(GameExited); Loaded += new RoutedEventHandler(WindowLoaded); Closing += new CancelEventHandler(WindowClosing); }
public ReceiptEditorViewModel() { AddReceiptCommand = new RelayCommand(OnAddReceipt, CanAddReceipt); DeleteReceiptCommand = new RelayCommand(OnDeleteReceipt, CanDeleteReceipt); SaveReceiptCommand = new RelayCommand(OnSaveReceipt, CanSaveReceipt); CancelEventHandler = Save; Receipts = ReceiptHelper.GetEditableTemplates(); }
public static CancelEventArgs RaiseCancelEvent(this object o, CancelEventHandler Handler, bool Cancel) { var e = new CancelEventArgs(Cancel); var HandlerLock = Handler; if (HandlerLock != null) { HandlerLock(o, e); } return e; }
public WizardForm() { this.InitializeComponent(); this.pageValidatedEventHandler = new EventHandler(this.Page_Validated); this.pageValidatingEventHandler = new CancelEventHandler(this.Page_Validating); this.buttonCancel.CausesValidation = false; }
/// <summary> /// Required method for Designer support /// Do not modify the contents of this method with the code editor. /// </summary> private void InitializeComponent() { components = new Container(); ResourceManager resources = new ResourceManager(typeof(MediaPortalEditor)); menuImageList = new ImageList(components); initTimer = new Timer(components); tabImageList = new ImageList(components); serviceImageList = new ImageList(components); statusBarIcons = new ImageList(components); // // menuImageList // menuImageList.ColorDepth = ColorDepth.Depth24Bit; menuImageList.ImageSize = new Size(16, 16); menuImageList.ImageStream = ((ImageListStreamer)(resources.GetObject("menuImageList.ImageStream"))); menuImageList.TransparentColor = Color.Magenta; // // initTimer // initTimer.Tick += new EventHandler(OnInitEditor); // // tabImageList // tabImageList.ColorDepth = ColorDepth.Depth24Bit; tabImageList.ImageSize = new Size(16, 16); tabImageList.ImageStream = ((ImageListStreamer)(resources.GetObject("tabImageList.ImageStream"))); tabImageList.TransparentColor = Color.Magenta; // // serviceImageList // serviceImageList.ColorDepth = ColorDepth.Depth24Bit; serviceImageList.ImageSize = new Size(16, 16); serviceImageList.ImageStream = ((ImageListStreamer)(resources.GetObject("serviceImageList.ImageStream"))); serviceImageList.TransparentColor = Color.Magenta; // // statusBarIcons // statusBarIcons.ColorDepth = ColorDepth.Depth24Bit; statusBarIcons.ImageSize = new Size(16, 16); statusBarIcons.ImageStream = ((ImageListStreamer)(resources.GetObject("statusBarIcons.ImageStream"))); statusBarIcons.TransparentColor = Color.Magenta; // // MediaPortalEditor // AutoScaleBaseSize = new Size(5, 13); BackColor = Color.Gray; ClientSize = new Size(704, 518); Icon = ((Icon)(resources.GetObject("$this.Icon"))); Name = "MediaPortalEditor"; Text = "MediaPortal - Skin Editor"; Closing += new CancelEventHandler(OnClosing); Load += new EventHandler(OnLoad); Closed += new EventHandler(OnClosed); }
public static CancelEventArgs RaiseCancelEvent(this object o, CancelEventHandler Handler, bool Cancel) { var e = new CancelEventArgs(Cancel); var HandlerLock = Handler; if (HandlerLock != null) { HandlerLock(o, e); } return(e); }
private void Window_Loaded(object sender, RoutedEventArgs e) { Closing += new CancelEventHandler(Window_Closing); Closed += new EventHandler(Window_Closed); listCategory.ItemsSource = Manager.Instance.AccessData.getCategories(Manager.Instance.CurrentUser); TextBoxCommentary.AcceptsReturn = true; listCategory.SelectedIndex = 0; this.item.Type = (Category)listCategory.SelectedValue; CreationDate.Text = (string)new Converter.DateTimeConverter().Convert(item.CreationDate, null, null, null); DatePickerToDoForDate.SelectedDate = this.item.ToDoForDate; }
public ProgressWindow(string title, string text) { WindowTitle = title; Text = text; DataContext = this; Owner = App.Current.MainWindow; WindowStartupLocation = WindowStartupLocation.CenterOwner; InitializeComponent(); ProgressBar.DataContext = ProgressBarData; Closing += new CancelEventHandler(OnClosing); }
/// <summary> /// Raises the <see cref="E:RadCommandBar.OrientationChanging"/> event. /// </summary> /// <param name="args">A <see cref="T:System.ComponentModel.CancelEventArgs"/> that contains the /// event data.</param> /// <returns>True if the change of orientation should be canceled, false otherwise.</returns> protected virtual bool OnOrientationChanging(CancelEventArgs args) { CancelEventHandler handler = (CancelEventHandler)this.Events[OrientationChangingEventKey]; if (handler != null) { handler(this, args); } return(args.Cancel); }
public Form1() { InitializeComponent(); Closing += new CancelEventHandler(Form1_Closing); mjp = new MjpegDecoder(); mjp.FrameReady += mjp_ready; Form.CheckForIllegalCrossThreadCalls = false; runCheckImgTask(); th = new Thread(StartTakePicture); th.Start(); }
public LogViewForm() { InitializeComponent(); uiScheduler = TaskScheduler.FromCurrentSynchronizationContext(); // Get the sharp shell event log. sharpShellEventLog = EventLog.GetEventLogs().FirstOrDefault(el => el.Log == "Application"); Closing += new CancelEventHandler(LogViewForm_Closing); }
public MainWindow() { InitializeComponent(); // Handle various lifetime events. Closing += new CancelEventHandler(MainWindow_Closing); Load += new EventHandler(MainWindow_Load); Closed += new EventHandler(MainWindow_Closed); Activated += new EventHandler(MainWindow_Activated); Deactivate += new EventHandler(MainWindow_Deactivate); }
public ThumbnailPreviewContextMenu(CoreLib core, Options options, ThumbnailPreview thumbnailPreview, ThumbnailGroupTable thumbnailGroupTable) { m_core = core; m_options = options; m_thumbnailPreview = thumbnailPreview; m_thumbnailGroupTable = thumbnailGroupTable; InitializeComponents(); UpdateStrings(); Resources.Strings.OnCurrentChange += new Resources.Strings.CurrentChangeHandler(UpdateStrings); Opening += new CancelEventHandler(OnOpening); }
public MainWindow() { InitializeComponent(); if (File.Exists(MangaDownloaderBase.LastDownloadLocation)) { SelectDownloadLocationButton.Content = File.ReadAllText(MangaDownloaderBase.LastDownloadLocation); } SelectHostCombo.ItemsSource = Enum.GetValues(typeof(Downloaders)); SelectHostCombo.SelectedIndex = (int)Downloaders.ReadMangaToday; Closing += new CancelEventHandler(DisposeMangaDownloader); }
public PythonConsole(Chat zchat) { InitializeComponent(); Closing += new CancelEventHandler(PythonConsole_Closing); ZChat = zchat; EntryHistory.Add(""); _pythonScope = ZChat.PythonEngine.CreateScope(); _pythonScope.SetVariable("zchat", ZChat); }
protected NavigationItem AddNavigationItem(string name, string imageName, CancelEventHandler eventHandler, string groupName, Image groupImage) { NavigationItem navigationItem = new NavigationItem(name, imageName); navigationItem.EventHandler = eventHandler; this.NavigationItems.Add(navigationItem); if (groupName != null) { this.AddExplorerBarItem(navigationItem, groupName, groupImage); } return(navigationItem); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponentSelf() { _txtTitle = new JetTextBox(); _toolbar = new RichEditToolbar(); _htmled = new MshtmlEdit(); Closing += new CancelEventHandler(OnBeforeCloseForm); SuspendLayout(); // // _txtTitle // _txtTitle.Location = new Point(36, 100); _txtTitle.Name = "_txtTitle"; _txtTitle.TabIndex = 1; _txtTitle.Text = ""; _txtTitle.Dock = DockStyle.Top; _txtTitle.TextChanged += new EventHandler(OnTitleChanged); _txtTitle.KeyDown += new KeyEventHandler(OnEditorKeyDown); // // _htmled // _htmled.Name = "_htmled"; _htmled.TabIndex = 2; _htmled.Dock = DockStyle.Fill; _htmled.add_KeyDown(new KeyEventHandler(OnEditorKeyDown)); // // _toolbar // // _toolbar.DropDownArrows = true; _toolbar.Location = new Point(0, 0); _toolbar.Name = "_toolbar"; _toolbar.TabStop = true; _toolbar.TabIndex = 3; // // _panelBody // _panelBody = new Panel(); _panelBody.BorderStyle = BorderStyle.Fixed3D; _panelBody.Controls.Add(_htmled); _panelBody.Dock = DockStyle.Fill; _panelBody.Name = "_panelBody"; _panelBody.TabIndex = 2; // // BlogExtensionComposer // AutoScaleBaseSize = new Size(5, 13); ClientSize = new Size(800, 600); Controls.Add(_panelBody); Controls.Add(_txtTitle); Controls.Add(_toolbar); Name = "BlogExtensionComposer"; Text = "Compose a Blog Entry"; ResumeLayout(false); }
/// ------------------------------------------------------------------------------------ private void HandleParentLanguageChange(IEnumerable <ParentButton> buttons, ParentButton selectedButton, CancelEventHandler changeHandler) { foreach (var pb in buttons.Where(x => x != selectedButton)) { pb.SelectedChanged -= HandleParentLanguageSelectedChanged; pb.SelectedChanging -= changeHandler; pb.Selected = false; pb.SelectedChanged += HandleParentLanguageSelectedChanged; pb.SelectedChanging += changeHandler; } }
public static void showMessageAsync(FrameworkElement parent, String message, CancelEventHandler onClose, Dialog.TYPE type = Dialog.TYPE.OK) { if (parent.Dispatcher.CheckAccess()) { showMessage(parent, message, onClose, type); } else { parent.Dispatcher.BeginInvoke(new showMessageAsyncDelegate2(showMessageAsync), new object[] { parent, message, onClose, type }); } }
internal CancelEventHandler ApplicationClosing() { var ce = new CancelEventHandler((object sender, System.ComponentModel.CancelEventArgs e) => { if (_minerProcesses != null && _minerProcesses.Count > 0) { _minerProcesses.ForEach(x => x.StopMiner()); } }); return(ce); }
public static void SetMainWindowCancelEventHandler(CancelEventHandler windowCancelEventHandler) { if (_mainWindow == null) { _windowCancelEventHandler = windowCancelEventHandler; } else { _mainWindow.Closing += windowCancelEventHandler; _windowCancelEventHandler = null; } }
public DockingListControl() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.ListItems.Font = Global.Default.Font; this.ListItems.ForeColor = Global.Default.ForeColor; this.ListItems.BackColor = Global.Default.BackColor; // create our handler for when the parent form is closing OnParentFormClosing = new CancelEventHandler(parentForm_Closing); }
/// <summary> /// Called when a feature is being rendered. /// </summary> /// <param name="cancel"> /// Value which can be set to indicate that the feature shouldn't be rendered. /// </param> protected virtual void OnFeatureRendering(ref Boolean cancel) { CancelEventHandler @event = FeatureRendering; if (@event != null) { CancelEventArgs args = new CancelEventArgs(cancel); @event(this, args); //Fire event cancel = args.Cancel; } }
/// <summary> /// Unsubscribes the specified event handler. /// </summary> /// <param name="handler">The event handler to unsubscribe from.</param> /// <param name="value">The event handler to unsubscribe.</param> public static void Unsubscribe(ref CancelEventHandler handler, CancelEventHandler value) { CancelEventHandler comparand; CancelEventHandler location = handler; do { comparand = location; location = Interlocked.CompareExchange(ref handler, (CancelEventHandler)Delegate.Remove(comparand, value), comparand); }while (location != comparand); }
/// <summary> /// Close all background threads if download form get closed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DownloadForm_Closed(object sender, CancelEventHandler e) { if (webClient.IsBusy) { webClient.CancelAsync(); } if (bgWorker.IsBusy) { bgWorker.CancelAsync(); } }
public WebsiteGeneralEditorControl() { InitializeComponent(); ReflectDataToForm += new DataEditorReflectEventHandler(WebsiteGeneralEditorControl_ReflectDataToForm); ReflectFormToData += new DataEditorReflectEventHandler(WebsiteGeneralEditorControl_ReflectFormToData); ValidateData += new CancelEventHandler(WebsiteGeneralEditorControl_ValidateData); websiteIisManagedPipelineModeInfoBindingSource.Clear(); addIisManagedPipelineMode(WebsiteIisManagedPipelineMode.Integrated); addIisManagedPipelineMode(WebsiteIisManagedPipelineMode.Classic); }
public ImagePreviewContextMenu(CoreLib core, Options options, CoreOptions coreOptions, ImagePreviewPanel imagePreviewPanel, ResultsListView resultsListView) { m_core = core; m_options = options; m_coreOptions = coreOptions; m_imagePreviewPanel = imagePreviewPanel; m_resultsListView = resultsListView; InitializeComponents(); UpdateStrings(); Resources.Strings.OnCurrentChange += new Resources.Strings.CurrentChangeHandler(UpdateStrings); Opening += new CancelEventHandler(OnOpening); }
public Form1() { Closing += new CancelEventHandler(Form1_Closing); Form1.CheckForIllegalCrossThreadCalls = false; InitializeComponent(); form = this; stopBEService(); ProcessModule module = FindModule(NameOfGame + ".exe"); calAdd = new Thread(getTheAddScore); calAdd.Start(); }
public static void SubscribeFileTabsWindowCancelEvent(CancelEventHandler windowCancelEventHandler) { if (_fileTabsWindow == null) { _windowCancelEventHandler = windowCancelEventHandler; } else { _fileTabsWindow.Closing += windowCancelEventHandler; _windowCancelEventHandler = null; } }
public MainWindow() { InitializeComponent(); MainWindowViewModel window = new MainWindowViewModel(); Closing += new CancelEventHandler(window.OnClosing); Closed += new EventHandler(window.OnClosed); DataContext = window; mainWindow = this; }
/// <summary> /// Configure <see cref="IDialogWindow"/> and <see cref="IDialogAware"/> events. /// </summary> /// <param name="dialogWindow">The hosting window.</param> /// <param name="callback">The action to perform when the dialog is closed.</param> internal static void ConfigureDialogWindowEvents(this IDialogWindow dialogWindow, Action <IDialogResult> callback) { Action <IDialogResult> requestCloseHandler = null; requestCloseHandler = (o) => { dialogWindow.Result = o; dialogWindow.Close(); }; RoutedEventHandler loadedHandler = null; loadedHandler = (o, e) => { dialogWindow.Loaded -= loadedHandler; dialogWindow.GetDialogViewModel().RequestClose += requestCloseHandler; }; dialogWindow.Loaded += loadedHandler; CancelEventHandler closingHandler = null; closingHandler = (o, e) => { if (!dialogWindow.GetDialogViewModel().CanCloseDialog()) { e.Cancel = true; } }; dialogWindow.Closing += closingHandler; EventHandler closedHandler = null; closedHandler = (o, e) => { dialogWindow.Closed -= closedHandler; dialogWindow.Closing -= closingHandler; dialogWindow.GetDialogViewModel().RequestClose -= requestCloseHandler; dialogWindow.GetDialogViewModel().OnDialogClosed(); if (dialogWindow.Result == null) { dialogWindow.Result = new DialogResult(); } callback?.Invoke(dialogWindow.Result); dialogWindow.DataContext = null; dialogWindow.Content = null; }; dialogWindow.Closed += closedHandler; }
/// <summary> /// Show SaveFileDialog 方式 /// </summary> /// <param name="Event"></param> static public void SaveFile(CancelEventHandler Event) { SaveFileDialog openfile = new SaveFileDialog(); openfile.Title = "选择保存的文件路径"; string[] buffer_path = System.AppDomain.CurrentDomain.BaseDirectory.Split(new string[] { "\\bin" }, StringSplitOptions.RemoveEmptyEntries); openfile.InitialDirectory = buffer_path[0]; openfile.Filter = "Excel文件|*.xlsx |TXT文件|*.txt"; //添加保存按钮触发事件 openfile.FileOk += Event; openfile.ShowDialog(); }
public ExportLogs(ILogProxy logProxy) { this.InitializeComponent(); VM = new ExportLogsViewModel(logProxy); VM.View = this; DataContext = VM; Closing += new CancelEventHandler((s, e) => { VM.CancelExporting(); }); }
private void HookEvents() { _listViewCannedMasks.SelectedIndexChanged += new EventHandler(listViewCannedMasks_SelectedIndexChanged); _listViewCannedMasks.ColumnClick += new ColumnClickEventHandler(listViewCannedMasks_ColumnClick); _listViewCannedMasks.Enter += new EventHandler(listViewCannedMasks_Enter); _btnOK.Click += new EventHandler(btnOK_Click); _txtBoxMask.TextChanged += new EventHandler(txtBoxMask_TextChanged); _txtBoxMask.Validating += new CancelEventHandler(txtBoxMask_Validating); _maskedTextBox.KeyDown += new KeyEventHandler(maskedTextBox_KeyDown); _maskedTextBox.MaskInputRejected += new MaskInputRejectedEventHandler(maskedTextBox_MaskInputRejected); Load += new EventHandler(MaskDesignerDialog_Load); HelpButtonClicked += new CancelEventHandler(MaskDesignerDialog_HelpButtonClicked); }
public Login() { InitializeComponent(); frmLogin = this; Closing += new CancelEventHandler(Login_Closing); #region 隱藏Windows工具列 APPBARDATA abd = new APPBARDATA(); abd.lParam = 3; SHAppBarMessage(ABM_SETSTATE, ref abd); #endregion }
/// <summary> /// Raises the BackstageViewOpening event. /// </summary> protected virtual bool OnBackstageViewOpening() { CancelEventHandler handler = (CancelEventHandler)this.Events[BackstageViewOpeningEventKey]; if (handler != null) { CancelEventArgs args = new CancelEventArgs(); handler(this, args); return(args.Cancel); } return(false); }
public MainWindow() { InitializeComponent(); Loaded += new RoutedEventHandler(MainWindow_Loaded); Closing += new CancelEventHandler(MainWindow_Closing); StateChanged += new EventHandler(MainWindow_StateChanged); LostKeyboardFocus += delegate { isKeyFocus = false; }; timer = new DispatcherTimer(DispatcherPriority.ApplicationIdle); timer.Interval = new System.TimeSpan(0, 0, 0, 0, 1); timer.Tick += new EventHandler(timer_Tick); }
protected virtual bool OnBackstageViewOpening() { CancelEventHandler cancelEventHandler = (CancelEventHandler)this.Events[RadRibbonBarBackstageView.BackstageViewOpeningEventKey]; if (cancelEventHandler == null) { return(false); } CancelEventArgs e = new CancelEventArgs(); cancelEventHandler((object)this, e); return(e.Cancel); }
public NewKnownFolder() { InitializeComponent(); bigtits.ImageSize = new Size(64, 64); bigtits.ColorDepth = ColorDepth.Depth32Bit; listView1.LargeImageList = bigtits; listView1.SetExplorerTheme(); listView1.DoubleClick += new EventHandler(listView1_DoubleClick); HelpButtonClicked += new CancelEventHandler(NewKnownFolder_HelpButtonClicked); bigtits.Images.Add(Properties.Resources.blankBox); Populate(); }
public Window1() { //#if DEBUG ConsoleManager.Show(); //#endif BasicConfigurator.Configure(new FileAppender(new SimpleLayout(), "window.log", true)); Console.WriteLine("Creating Window"); activityImages = new Dictionary<string, ImageSource>(); Loaded += new RoutedEventHandler(Window1_Loaded); InitializeComponent(); Closing += new CancelEventHandler(Window1_Closing); }
public Window1() { InitializeComponent(); DataContext = this; Config = new ScanConfig() { RunViewer = true }; Loaded += new RoutedEventHandler(Window1_Loaded); Closing += new CancelEventHandler(Window1_Closing); var l = Assembly.GetExecutingAssembly().Location; _phpvhExe = new FileInfo(l).Directory + "\\phpvh.exe"; }
/// <summary> /// /// </summary> /// <param name="vm_"></param> public NewScriptWindow(ScriptElement var_ = null) { InitializeComponent(); if (var_ == null) { Title = "New script"; } else { InputName = var_.Name; } Closing += new CancelEventHandler(OnClosing); }
/// <summary> /// /// </summary> /// <param name="vm_"></param> public NewNamedVarWindow(NamedVariable var_ = null) { InitializeComponent(); if (var_ == null) { Title = "New named variable"; comboBox.SelectedIndex = 0; } else { InputName = var_.Name; comboBox.IsEnabled = false; } Closing += new CancelEventHandler(OnClosing); }
public SatelliteApplicationForm() { // allow windows to determine the location for new windows StartPosition = FormStartPosition.WindowsDefaultLocation; // use standard product icon Icon = ApplicationEnvironment.ProductIcon; // subscribe to resize event Resize += new EventHandler(SatelliteApplicationForm_Resize); // subscribe to closing event Closing += new CancelEventHandler(SatelliteApplicationForm_Closing); // Redraw if resized (mainly for the designer). SetStyle(ControlStyles.ResizeRedraw, true); DockPadding.Bottom = 0; }
/// <summary> /// /// </summary> /// <param name="vm_"></param> public SequenceParametersWindow(FlowGraphControlViewModel vm_ = null, IsValidInputNameDelegate callback_ = null) { InitializeComponent(); IsValidInputNameCallback = callback_; if (vm_ == null) { Title = "New Graph parameters"; } else { Title = "Graph " + vm_.Name + " parameters"; textBoxName.Text = vm_.Name; textBoxDescription.Text = vm_.Description; } Closing += new CancelEventHandler(OnClosing); }
public ObjectListView() { OnObjectSaveHandler = new System.EventHandler(this.OnObjectSave); OnObjectDeleteHandler = new System.EventHandler(this.OnObjectDelete); OnObjectValueChangedHandler = new System.ComponentModel.PropertyChangedEventHandler(this.OnObjectValueChanged); OnContextColumnMenuHandler = new EventHandler(this.OnContextMenuColumnVisibility); // this.SmallImageList = SharedResources.SmallIconImageList; // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitForm call this.View = System.Windows.Forms.View.Details; this.FullRowSelect = true; this.AllowColumnReorder = true; // create our handler for when the parent form is closing OnParentFormClosing = new CancelEventHandler(parentForm_Closing); }