/// <summary> /// A form for token /// </summary> /// <returns>bool true if OK was pressed, false if cancel</returns> public bool ShowConfigDialog() { DialogResult result = new SettingsForm(this).ShowDialog(); if (result == DialogResult.OK) { return true; } return false; }
/// <summary> /// A form for token /// </summary> /// <returns>bool true if OK was pressed, false if cancel</returns> public bool ShowConfigDialog() { SettingsForm settingsForm; ILanguage lang = Language.GetInstance(); BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(BoxPlugin.Attributes.Name, lang.GetString(LangKey.communication_wait)); try { settingsForm = new SettingsForm(this); } finally { backgroundForm.CloseDialog(); } settingsForm.UploadFormat = this.UploadFormat.ToString(); settingsForm.AfterUploadOpenHistory = this.AfterUploadOpenHistory; settingsForm.AfterUploadLinkToClipBoard = this.AfterUploadLinkToClipBoard; settingsForm.AuthToken = this.boxToken; settingsForm.DefaultSize = this.PictureDisplaySize.ToString(); DialogResult result = settingsForm.ShowDialog(); if (result == DialogResult.OK) { this.UploadFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), settingsForm.UploadFormat.ToLower()); this.AfterUploadOpenHistory=settingsForm.AfterUploadOpenHistory; this.AfterUploadLinkToClipBoard=settingsForm.AfterUploadLinkToClipBoard; this.boxToken = settingsForm.AuthToken; this.PictureDisplaySize = (PictureDisplaySize)Enum.Parse(typeof(PictureDisplaySize), settingsForm.DefaultSize); IniConfig.Save(); return true; } return false; }