Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
        /// <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 "";
            }
        }