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 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(); } }