/// <summary> /// Gets the unit from the full parameter name by converting it to a abrev and then /// sending it to getUnitAbrev /// </summary> /// <param name="fullParam">The paramater you want to find the abreviation for</param> /// <returns></returns> public string getUnitFull(ParameterFull fullParam) { ParameterAbrev abrev; Enum.TryParse(getAbrev(fullParam), out abrev); return getUnitAbrev(abrev); }
/// <summary> /// Given the full parameter name returns the abreviation /// </summary> /// <param name="fullName">The full name we want to find the abreviation for</param> /// <returns></returns> public static string getAbrev(ParameterFull fullName) { if (Enum.IsDefined(typeof(ParameterFull), fullName) | fullName.ToString().Contains(",")) { var val = Convert.ChangeType(fullName, fullName.GetTypeCode()); var oval = Enum.GetName(typeof(ParameterAbrev), val); return oval; } else { return ""; } }