public void AddFavCID() { FavClient fvcTemp = FavClient.FindClient(intCID); isFav = true; if (fvcTemp == null) { listFavs.Add(new FavClient(this, null, intCID)); listFavCIDs.Add(intCID); using (StreamWriter sw = File.AppendText(strCIDFile)) { sw.WriteLine(intCID); } } else if (fvcTemp.intCID == null) { fvcTemp.intCID = intCID; listFavCIDs.Add(intCID); using (StreamWriter sw = File.AppendText(strCIDFile)) { sw.WriteLine(intCID); } } else { throw new ArgumentException(); } }
public void AddFavCS() { FavClient fvcTemp = FavClient.FindClient(strCallsign); isFav = true; if (fvcTemp == null) { listFavs.Add(new FavClient(this, strCallsign)); listFavCSs.Add(strCallsign); using (StreamWriter sw = File.AppendText(strCSFile)) { sw.WriteLine(strCallsign); } } else if (fvcTemp.strCallsign == null) { fvcTemp.strCallsign = strCallsign; listFavCSs.Add(strCallsign); using (StreamWriter sw = File.AppendText(strCSFile)) { sw.WriteLine(strCallsign); } } else { throw new ArgumentException(); } }
public static void UpdateFavs() { foreach (Client cltClt in list) { cltClt.isFav = false; } listFavs = new List <FavClient>(); List <string> listTempCS = new List <string>(listFavCSs); foreach (int intInt in listFavCIDs) { Client cltTemp = FindNoATIS(intInt); FavClient fvcFvc = new FavClient(cltTemp, null, intInt); if (cltTemp != null) { fvcFvc.cltClient.isFav = true; if (listTempCS.Contains(cltTemp.strCallsign)) { fvcFvc.strCallsign = cltTemp.strCallsign; listTempCS.Remove(cltTemp.strCallsign); } } listFavs.Add(fvcFvc); } foreach (string strStr in listTempCS) { Client cltTemp = Find(strStr); if (cltTemp != null) { cltTemp.isFav = true; } listFavs.Add(new FavClient(cltTemp, strStr)); } }