private void btnThingListSaveImages_Click(object sender, EventArgs e) { this.PrepareFolderBrowser(I18N.GetText("Description:BrowseImageExportFolder")); if (this.dlgBrowseFolder.ShowDialog() == DialogResult.OK) { PleaseWaitDialog PWD = new PleaseWaitDialog(I18N.GetText("Dialog:SaveAllImages")); Thread T = new Thread(new ThreadStart(delegate() { Application.DoEvents(); foreach (IThing X in this.LoadedThings_) { Image I = X.GetIcon(); // FIXME: Assumes no IThing has more than one image if (I != null) { string ImageFileName = X.ToString() + ".png"; foreach (char C in Path.GetInvalidFileNameChars()) { ImageFileName = ImageFileName.Replace(C, '_'); } I.Save(Path.Combine(this.dlgBrowseFolder.SelectedPath, ImageFileName), ImageFormat.Png); } Application.DoEvents(); } PWD.Invoke(new AnonymousMethod(delegate() { PWD.Close(); })); })); T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; T.Start(); PWD.ShowDialog(this); this.Activate(); PWD.Dispose(); PWD = null; } }
/// <summary> /// Runs this instance. /// </summary> /// <remarks></remarks> public virtual void Run(RunMode mode) { if (_form == null) { _form = CreatePluginForm(); } if (_form is Window) { if (mode == RunMode.Normal) { ((Window)_form).Show(); } else { ((Window)_form).ShowDialog(); } ((Window)_form).Activate(); } if ((_form is Form)) { if (mode == RunMode.Normal) { ((Form)_form).Show(); } else { ((Form)_form).ShowDialog(); } ((Form)_form).Activate(); } PleaseWaitDialog.Close(); }
/// <summary> /// Registers the new user completed. /// </summary> /// <param name="item">The item.</param> private void RegisterNewUserCompleted(UserRegistrationInfo item) { PleaseWaitDialog.Close(); DataContext = item; DialogResult = !item.HasErrors; if (Convert.ToBoolean(DialogResult)) { Close(); } }
/// <summary> /// Called when [login completed]. /// </summary> /// <remarks></remarks> public void OnLoginCompleted() { PleaseWaitDialog.Show("User [{0}] authenticated.\nWelcome, {1}.", WulkaSession.Current.Username, WulkaSession.Current.FirstName); Thread.Sleep(1500); PleaseWaitDialog.Close(); IsAuthenticated = true; IsBusy = false; InitializeInternal(InitializationParams); }
private void btnThingListSaveImages_Click(object sender, EventArgs e) { this.PrepareFolderBrowser(I18N.GetText("Description:BrowseImageExportFolder")); if (this.dlgBrowseFolder.ShowDialog() == DialogResult.OK) { PleaseWaitDialog PWD = new PleaseWaitDialog(I18N.GetText("Dialog:SaveAllImages")); Thread T = new Thread(new ThreadStart(delegate () { Application.DoEvents(); foreach (IThing X in this.LoadedThings_) { Image I = X.GetIcon(); // FIXME: Assumes no IThing has more than one image if (I != null) { string ImageFileName = X.ToString() + ".png"; foreach (char C in Path.GetInvalidFileNameChars()) ImageFileName = ImageFileName.Replace(C, '_'); I.Save(Path.Combine(this.dlgBrowseFolder.SelectedPath, ImageFileName), ImageFormat.Png); } Application.DoEvents(); } PWD.Invoke(new AnonymousMethod(delegate() { PWD.Close(); })); })); T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; T.Start(); PWD.ShowDialog(this); this.Activate(); PWD.Dispose(); PWD = null; } }