public void ParseLogoObject(string data) { if (LogoObjectList == null) { LogoObjectList = new ObservableCollection <LogoObject>(); } LogoObjectList.Clear(); string[] text = data.Split(';'); foreach (string s in text) { try { if (!string.IsNullOrEmpty(s)) { string[] t = s.Trim().Split(':'); LogoObject l = new LogoObject(t[0], Convert.ToInt32(t[1]), Convert.ToInt32(t[2])); LogoObjectList.Add(l); } } catch { // ignored } } }
public async Task AddNewPlatform(string platformName, string platformAbbreviation, string size) { Platform p = new Platform { Name = platformName, Icon = platformAbbreviation, SaveLogoList = new List <LogoObject>() }; string[] text = size.Split(';'); foreach (string s in text) { if (!string.IsNullOrEmpty(s)) { string[] t = s.Trim().Split(':'); LogoObject l = new LogoObject(t[0], Convert.ToInt32(t[1]), Convert.ToInt32(t[2])); p.SaveLogoList.Add(l); } } StaticData.StartVm.CustomData.PlatformList.Add(p); //Save all change to file await StorageHelper.Object2Json(StaticData.StartVm.CustomData, "custom.dat"); }