/// <summary> /// Returns a string representing this channel. /// </summary> /// <remarks> /// If both <see cref="P:MajorChannel"/> and <see cref="P:MinorChannel"/> are defined, it will return a string in the form "X.X". /// If only <see cref="P:MajorChannel"/> is defined, the string will simply be "X". /// If <see cref="P:MajorChannel"/> and <see cref="P:PhysicalChannel"/> are the same, and <see cref="P:MinorChannel"/> is 0 or -1, ti will return the physical channel in the format "X". /// If only the <see cref="P:PhysicalChannel"/> is defined, then that will be shown, in the form "X". /// If nothing else, the <see cref="P:PhysicalChannel"/>, <see cref="P:MajorChannel"/>, and <see cref="P:MinorChannel"/> will all be listed, in the format "X X X". /// </remarks> public override string ToString() { if ((MajorChannel > -1) && (MinorChannel > -1)) { return(MajorChannel.ToString() + "." + MinorChannel.ToString()); } else if ((PhysicalChannel < 0) && (MajorChannel > -1)) { return(MajorChannel.ToString()); } else if ((PhysicalChannel == MajorChannel) && (MinorChannel <= 0)) { return(PhysicalChannel.ToString()); } else if ((MajorChannel < 0) && (PhysicalChannel > -1)) { return(PhysicalChannel.ToString()); } else { return(PhysicalChannel.ToString() + " " + MajorChannel.ToString() + "." + MinorChannel.ToString()); } }
/// <summary> /// Returns a string with all of the parameters shown /// </summary> /// <remarks>Shown in the format "<see cref="P:PhysicalChannel"/> <see cref="P:MajorChannel"/> <see cref="P:MinorChannel"/> <see cref="P:CarrierFrequency"/> <see cref="P:Callsign"/>"</remarks> public string ToDebugString() { return(PhysicalChannel.ToString() + " " + MajorChannel.ToString() + "." + MinorChannel.ToString() + " " + CarrierFrequency.ToString() + " " + Callsign); }