public FileMenu(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal, CloseFormDelegate cfd) { this.Text = Strings.File; open_deck_ = new OpenDeckMenuItem(model, marshal); this.MenuItems.Add(open_deck_); this.MenuItems.Add(new CloseDeckMenuItem(dispatcher, model, marshal)); this.MenuItems.Add(new MenuItem("-"));// Text of "-" signifies a separator bar. this.MenuItems.Add(new SaveDeckMenuItem(model, marshal)); this.MenuItems.Add(new SaveDeckAsMenuItem(model, marshal)); this.MenuItems.Add(new SaveAllDecksMenuItem(model, marshal)); this.MenuItems.Add(new SaveAllDecksAsMenuItem(model, marshal)); this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar. this.MenuItems.Add(new ExportDeckAsImageItem(model)); this.MenuItems.Add(new ExportDeckAsHTMLItem(model)); this.MenuItems.Add(new ExportInkMenuItem(model)); this.MenuItems.Add(new MenuItem("-")); this.MenuItems.Add(new PageSetupMenuItem(this, model)); this.MenuItems.Add(new PrintPreviewMenuItem(this, model)); this.MenuItems.Add(new PrintMenuItem(this, model)); this.MenuItems.Add(new MenuItem( "-" )); this.MenuItems.Add(new ExitMenuItem(cfd)); presenter_model_ = model; presenter_model_.Workspace.CurrentPresentation.ListenAndInitialize(dispatcher, new Property<PresentationModel>.EventHandler(this.HandlePresentationChanged)); presenter_model_.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher, new Property<DeckTraversalModel>.EventHandler(this.HandleDeckChanged)); }
private void CloseFormWithThread() { if (dgCloseForm == null) { dgCloseForm = new CloseFormDelegate(this.Close); } this.Invoke(dgCloseForm); }
void SetupDelegates() { updateServerLogDelegate = new UpdateServerLogDelegate(UpdateServerLog); updateConnectionLabelsDelegate = new UpdateConnectionLabelsDelegate(UpdateConnectionLabels); closeFormDelegate = new CloseFormDelegate(CloseForm); getNameDelegate = new GetNameDelegate(GetName); getColorDelegate = new GetColorDelegate(GetColor); }
public void Stop(IBundleContext context) { context.RemoveService <Form>(_mainForm); CloseFormDelegate closeFormDel = delegate() { _mainForm.Close(); }; }
public ServerWindow()//Server_Server server { InitializeComponent(); ApplyLayoutChanges(); updateServerLogDelegate = new UpdateServerLogDelegate(UpdateServerLog); updateConnectionLabelsDelegate = new UpdateConnectionLabelsDelegate(UpdateConnectionLabels); closeFormDelegate = new CloseFormDelegate(CloseForm); //this.server = server; InputBox.Select(); }
public virtual void CloseForm() { if (this.InvokeRequired) { CloseFormDelegate dele = new CloseFormDelegate(CloseForm2); this.Invoke(dele); } else { CloseForm2(); } }
private void CloseForm() { if (this.InvokeRequired) { CloseFormDelegate d = new CloseFormDelegate(CloseForm); this.Invoke(d); } else { this.Close(); } }
public void CloseForm() { if (InvokeRequired) { var d = new CloseFormDelegate(CloseForm); Invoke(d, new object[] { }); } else { Close(); } }
void AlertForm_AutoCloseFormEvent() { if (this.InvokeRequired) { CloseFormDelegate closeForm = new CloseFormDelegate(Close); this.Invoke(closeForm); } else { this.Close(); } }
public frmDownload(DownloadTask downloadTask) { InitializeComponent(); this.downloadTask = downloadTask; timer = new Timer(); timer.Tick += Timer_Tick; timer.Interval = 100; timer.Start(); DownloadManager.Instance.Download(downloadTask); downloadTask.DownloadFinished += DownloadTask_DownloadFinished; downloadTask.DownloadFailture += DownloadTask_DownloadFailture; progressBar2.Maximum = 100; changeButtonTextDelegate = new ChangeButtonTextDelegate(ChangeButtonTextDelegateMethod); closeFormDelegate = new CloseFormDelegate(CloseFormDelegateMethod); InitLanguageOptions(); }
/// <summary> /// 关闭提示框 /// </summary> public void closeMsgForm() { if (sMessageForm == null) { return; } if (sMessageForm.InvokeRequired) { CloseFormDelegate pro = new CloseFormDelegate(closeMsgForm); sMessageForm.Invoke(pro); } else { sMessageForm.Close(); sMessageForm.Dispose(); this.Close(); this.Dispose(); } }
private void CloseForm() { if (this.InvokeRequired == true) { CloseFormDelegate d = new CloseFormDelegate(CloseForm); try { this.Invoke(d); } catch { // do no_op } } else { isThreadStarted = false; this.Close(); } }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">True if managed resources should be disposed; otherwise, false.</param> protected virtual void Dispose(bool disposing) { if (disposing) { lock (_syncRoot) { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; _hideEvent.Set(); _hideEvent.Close(); if (_form != null) { if (_form.IsHandleCreated) { CloseFormDelegate methodCloseForm = new CloseFormDelegate(CloseForm); _form.Invoke(methodCloseForm, _form); } if (!_form.IsDisposed) { _form.Dispose(); } _form = null; } if (_label != null) { _label.Dispose(); _label = null; } if (_progressBar != null) { _progressBar.Dispose(); _progressBar = null; } } } }
public ExitMenuItem(CloseFormDelegate cfd) { this.Text = Strings.Exit; this.m_CFD = cfd; }
void RegisterMachineID_AutoCloseFormEvent() { if (this.InvokeRequired) { CloseFormDelegate closeForm = new CloseFormDelegate(Close); this.Invoke(closeForm); } else { this.Close(); } }
private void CloseForm(Form form) { if (this.InvokeRequired) { CloseFormDelegate d = new CloseFormDelegate(CloseForm); this.Invoke(d, form); } else { form.Close(); } }
public Form1() { InitializeComponent(); FormClosing += Form1_FormClosing; myDelegate = new CloseFormDelegate(CloseMyForm); //Sets how many simultaneous bots you can have open //int maxBots; //if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > maxBots) System.Diagnostics.Process.GetCurrentProcess().Kill(); Authorize(); int x = Screen.PrimaryScreen.Bounds.Right - this.Width; int y = Screen.PrimaryScreen.Bounds.Top + 3; this.Location = new Point(x, y); //this.TopMost = true; if (!Directory.Exists(fileLocation)) { DirectoryInfo info = Directory.CreateDirectory(fileLocation); } }
public FileMenu(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal, CloseFormDelegate cfd) { this.Text = Strings.File; open_deck_ = new OpenDeckMenuItem(model, marshal); this.MenuItems.Add(open_deck_); this.MenuItems.Add(new CloseDeckMenuItem(dispatcher, model, marshal)); this.MenuItems.Add(new MenuItem("-"));// Text of "-" signifies a separator bar. this.MenuItems.Add(new SaveDeckMenuItem(model, marshal)); this.MenuItems.Add(new SaveDeckAsMenuItem(model, marshal)); this.MenuItems.Add(new SaveAllDecksMenuItem(model, marshal)); this.MenuItems.Add(new SaveAllDecksAsMenuItem(model, marshal)); this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar. this.MenuItems.Add(new ExportDeckAsImageItem(model)); this.MenuItems.Add(new ExportDeckAsHTMLItem(model)); this.MenuItems.Add(new ExportInkMenuItem(model)); this.MenuItems.Add(new MenuItem("-")); this.MenuItems.Add(new PageSetupMenuItem(this, model)); this.MenuItems.Add(new PrintPreviewMenuItem(this, model)); this.MenuItems.Add(new PrintMenuItem(this, model)); this.MenuItems.Add(new MenuItem("-")); this.MenuItems.Add(new ExitMenuItem(cfd)); presenter_model_ = model; presenter_model_.Workspace.CurrentPresentation.ListenAndInitialize(dispatcher, new Property <PresentationModel> .EventHandler(this.HandlePresentationChanged)); presenter_model_.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher, new Property <DeckTraversalModel> .EventHandler(this.HandleDeckChanged)); }
public Caculating() { InitializeComponent(); myDelegate = new CloseFormDelegate(CloseMyForm); }