public FormSettings(IceChatOptions Options, IceChatFontSetting Fonts, IceChatEmoticon Emoticons, IceChatSounds Sounds, bool showFonts) { InitializeComponent(); this.iceChatOptions = Options; this.iceChatFonts = Fonts; this.iceChatEmoticons = Emoticons; this.iceChatSounds = Sounds; LoadSettings(); this.Activated += new EventHandler(OnActivated); if (showFonts == true) tabControlOptions.SelectedTab = tabFonts; }
public FormSettings(IceChatOptions Options, IceChatFontSetting Fonts, IceChatEmoticon Emoticons, IceChatSounds Sounds) { InitializeComponent(); this.iceChatOptions = Options; this.iceChatFonts = Fonts; this.iceChatEmoticons = Emoticons; this.iceChatSounds = Sounds; LoadSettings(); this.Activated += new EventHandler(OnActivated); this.textNickComplete.KeyDown += new KeyEventHandler(OnKeyDown); pictureTSHelp.Image = StaticMethods.LoadResourceImage("help.png"); pictureTSHelp.Click += new EventHandler(pictureTSHelp_Click); }
private void LoadFonts() { if (File.Exists(fontsFile)) { XmlTextReader textReader = null; try { XmlSerializer deserializer = new XmlSerializer(typeof(IceChatFontSetting)); textReader = new XmlTextReader(fontsFile); iceChatFonts = (IceChatFontSetting)deserializer.Deserialize(textReader); textReader.Close(); if (iceChatFonts.FontSettings.Length < 9) LoadDefaultFontSettings(); } catch (Exception) { textReader.Close(); errorMessages.Add("There was a problem loading IceChatFonts.xml. Default font settings loaded"); iceChatFonts = new IceChatFontSetting(); LoadDefaultFontSettings(); } } else { iceChatFonts = new IceChatFontSetting(); LoadDefaultFontSettings(); } }
private void FirstRunSaveOptions(IceChatOptions options, IceChatFontSetting fonts) { this.iceChatOptions = options; this.iceChatFonts = fonts; SaveFonts(); SaveOptions(); }
private void LoadDefaultFontSettings() { IceChatFontSetting oldFonts = new IceChatFontSetting(); oldFonts.FontSettings = new FontSettingItem[9]; if (iceChatFonts.FontSettings != null) { iceChatFonts.FontSettings.CopyTo(oldFonts.FontSettings, 0); iceChatFonts.FontSettings = new FontSettingItem[9]; oldFonts.FontSettings.CopyTo(iceChatFonts.FontSettings, 0); } else iceChatFonts.FontSettings = new FontSettingItem[9]; if (oldFonts.FontSettings[0] == null || iceChatFonts.FontSettings[0].FontName.Length == 0) iceChatFonts.FontSettings[0] = NewFontSetting("Console", "Verdana", 10); else iceChatFonts.FontSettings[0] = oldFonts.FontSettings[0]; if (oldFonts.FontSettings[1] == null || iceChatFonts.FontSettings[1].FontName.Length == 0) iceChatFonts.FontSettings[1] = NewFontSetting("Channel", "Verdana", 10); else iceChatFonts.FontSettings[1] = oldFonts.FontSettings[1]; if (oldFonts.FontSettings[2] == null || iceChatFonts.FontSettings[2].FontName.Length == 0) iceChatFonts.FontSettings[2] = NewFontSetting("Query", "Verdana", 10); else iceChatFonts.FontSettings[2] = oldFonts.FontSettings[2]; if (oldFonts.FontSettings[3] == null || iceChatFonts.FontSettings[3].FontName.Length == 0) iceChatFonts.FontSettings[3] = NewFontSetting("Nicklist", "Verdana", 10); else iceChatFonts.FontSettings[3] = oldFonts.FontSettings[3]; if (oldFonts.FontSettings[4] == null || iceChatFonts.FontSettings[4].FontName.Length == 0) iceChatFonts.FontSettings[4] = NewFontSetting("Serverlist", "Verdana", 10); else iceChatFonts.FontSettings[4] = oldFonts.FontSettings[4]; if (oldFonts.FontSettings[5] == null || iceChatFonts.FontSettings[5].FontName.Length == 0) iceChatFonts.FontSettings[5] = NewFontSetting("InputBox", "Verdana", 10); else iceChatFonts.FontSettings[5] = oldFonts.FontSettings[5]; if (oldFonts.FontSettings[6] == null || iceChatFonts.FontSettings[6].FontName.Length == 0) iceChatFonts.FontSettings[6] = NewFontSetting("DockTabs", "Verdana", 10); else iceChatFonts.FontSettings[6] = oldFonts.FontSettings[6]; if (oldFonts.FontSettings[7] == null || iceChatFonts.FontSettings[7].FontName.Length == 0) iceChatFonts.FontSettings[7] = NewFontSetting("MenuBar", "Verdana", 10); else iceChatFonts.FontSettings[7] = oldFonts.FontSettings[7]; if (oldFonts.FontSettings[8] == null || iceChatFonts.FontSettings[8].FontName.Length == 0) iceChatFonts.FontSettings[8] = NewFontSetting("ChannelBar", "Verdana", 10); else iceChatFonts.FontSettings[8] = oldFonts.FontSettings[8]; oldFonts = null; SaveFonts(); }