public Codeplug(string filename) { byte[] bytes = File.ReadAllBytes(filename); Channels = new Channels(bytes); Contacts = new Contacts(bytes); RxGroups = new RxGroups(bytes); Zones = new Zones(bytes); }
public override string ToString() { Type t = this.GetType(); string rtn = "____ " + t.Name.ToUpper() + " ____\r\n"; switch (t.Name) { case "Channels": Channels channels = (Channels)this; for (int i = 0; i < channels.Items.Count; i++) { Channel obj = channels.Items.ToList()[i].Value; rtn += obj.Name + " " + channels.Items.ToList()[i].Key.ToString() + " " + obj.Name + "\r\n"; } break; case "Contacts": Contacts contacts = (Contacts)this; for (int i = 0; i < contacts.Items.Count; i++) { Contact obj = contacts.Items.ToList()[i].Value; rtn += obj.Name + " " + obj.ID.ToString() + " " + obj.Name + "\r\n"; } break; case "RxGroups": RxGroups rxGroups = (RxGroups)this; for (int i = 0; i < rxGroups.List.Count; i++) { RxGroup obj = rxGroups.List[i]; rtn += obj.Name + " " + obj.Name + "\r\n"; } break; case "Zones": Zones zones = (Zones)this; for (int i = 0; i < zones.List.Count; i++) { Zone obj = zones.List[i]; rtn += obj.Name + "(Contact indexes: "; for (int j = 0; j < obj.ChannelIndexList.Count; j++) { rtn += obj.ChannelIndexList[j].ToString(); if (j < obj.ChannelIndexList.Count - 1) { rtn += ", "; } } rtn += ")\r\n"; } break; case "ScanLists": rtn += "ScanLists.ListItems() not implemented.\r\n"; break; } return(rtn); }