public static string ToShortName(this DetectorType type) { string detectorTypeName; switch (type) { case DetectorType.QuadBSD: detectorTypeName = "Quad BSED"; break; case DetectorType.PMT: detectorTypeName = "PMD-BSE"; break; case DetectorType.HiResOptical: detectorTypeName = "HRO"; break; case DetectorType.HiResOpticalLowMag: detectorTypeName = "HRO-LM"; break; case DetectorType.None: detectorTypeName = "No Det."; break; default: detectorTypeName = type.ToName(); break; } return(detectorTypeName); }
public static string ToName(this DetectorType type, DetectorTypeNameForm name) { switch (name) { case DetectorTypeNameForm.Normal: return(type.ToName()); case DetectorTypeNameForm.Short: return(type.ToShortName()); default: throw new ArgumentException("Unknown name kind"); } }