private Theme SaveTheme() { StringContainer strContainer = new StringContainer(); DialogResult result = new InputDialog().ShowDialog("Please type the theme name:", strContainer); if (result != DialogResult.OK) { return(null); } if (ThemeManager.Contains(strContainer.Value)) { yMessageBox.ShowError(this, "Your input theme name is already existed, please type another one!", "Error"); return(null); } Theme theme = CreateTheme(strContainer.Value); ThemeManager.AddTheme(theme); ThemeManager.SaveThemeToFile(); comboxThemeList.Items.Clear(); comboxThemeList.Items.AddRange(ThemeManager.GetAllThemeNames()); comboxThemeList.Text = AppConfig.CurrentThemeName; return(theme); }
public DialogResult ShowDialog(string title, StringContainer strCon) { this.Text = title; this.StartPosition = FormStartPosition.CenterParent; _strContainer = strCon; return(ShowDialog()); }