public void Load() { string[] code = Main.Properties.Settings.Default.ChatSave.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); foreach (var x in code) { string[] pp = x.Split(','); int id = int.Parse(pp[0]); foreach (var s in TwoRatChat.Main.Sources.SourceManager.Sources) { if (s.Id == id) { AddSource(s, pp[1], pp[2]); break; } } } //code = Main.Properties.Settings.Default.voice_Personals.Split( new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries ); //foreach( var x in code ) { // string[] pp = x.Trim( ' ', '\r', '\n', '\t' ).Split( ',' ); // PersonalData pd = new Main.Model.PersonalData(); // pd.VoiceHello = pp[1]; // if( pp.Length > 2 ) // pd.CustomIcon = pp[2]; // PersonalData[pp[0]] = pd; //} //PersonalData["TwoRatChat"] = new Main.Model.PersonalData() { VoiceHello = "", CustomIcon = "" }; BlackList.Load(Main.Properties.Settings.Default.Chat_Blacklist); ImageBlackList.Load(Main.Properties.Settings.Default.imageBlackList); ImageWhiteList.Load(Main.Properties.Settings.Default.imageWhiteList); // this._LevelManager.Load(); }
public void Save() { // this._LevelManager.Save(); StringBuilder sb = new StringBuilder(); foreach (var s in _sources) { sb.AppendFormat("{0},{1},{2};", s.SystemId, s.Uri, s.Label); } Main.Properties.Settings.Default.ChatSave = sb.ToString(); Main.Properties.Settings.Default.Chat_Blacklist = BlackList.Save(); Main.Properties.Settings.Default.imageBlackList = ImageBlackList.Save(); Main.Properties.Settings.Default.imageWhiteList = ImageWhiteList.Save(); this.CustomUsers.Save(); //sb.Clear(); //foreach ( var pd in PersonalData ) // sb.AppendFormat( "{0},{1},{2};", pd.Key, pd.Value.VoiceHello, pd.Value.CustomIcon ); //Main.Properties.Settings.Default.voice_Personals = sb.ToString(); }