private static void ReadOSPMasterListIntoMsgCounts() { uint md = 0; uint sb = 0; string nm = ""; string str2 = ""; messageCounts item = new messageCounts(0, 0, " "); messageCounts counts2 = new messageCounts(0, 0, " "); bool flag = true; MsgCounts.Clear(); string str3 = ConfigurationManager.AppSettings["InstalledDirectory"]; StreamReader reader = new StreamReader(str3 + @"\scripts\OSPmasterMIDlist.csv"); string str5 = reader.ReadLine(); str5 = reader.ReadLine(); while (!reader.EndOfStream) { str5 = reader.ReadLine(); if (((str5.IndexOf("removed from OSP") <= 0) && (str5.Substring(0, 6) != ",,,,,,")) && (str5.Substring(0, 12) != ",,,,,Nothing")) { if (str5.Substring(0, 3) == ",,,") { string[] strArray = str5.Split(new string[] { ",", " " }, StringSplitOptions.RemoveEmptyEntries); sb = Convert.ToUInt32(strArray[0], 0x10); str2 = strArray[2]; if (flag) { MsgCounts.Remove(counts2); flag = false; } item = new messageCounts(md, sb, nm + " - " + str2); MsgCounts.Add(item); } else if ((str5.IndexOf('x') > 0) || (str5.IndexOf('X') > 0)) { string[] strArray2 = str5.Split(new string[] { ",", " " }, StringSplitOptions.RemoveEmptyEntries); md = Convert.ToUInt32(strArray2[0], 0x10); if (strArray2.Length > 2) { nm = strArray2[2]; } else { nm = "Unknown"; } item = new messageCounts(md, nm); MsgCounts.Add(item); counts2 = item; flag = true; } } } reader.Close(); }
private static int MsgCountCompare(messageCounts a, messageCounts b) { int num = 0; if (a.mid > b.mid) { return 1; } if (a.mid < b.mid) { return -1; } if (a.mid == b.mid) { if (a.subID > b.subID) { return 1; } if (a.subID < b.subID) { num = -1; } } return num; }