Esempio n. 1
0
 public static FontStretch GetFontStretchFromInvariantStringOrNormal(string value)
 {
     try
     {
         return((FontStretch)fontStretchConverter.ConvertFromInvariantString(value));
     }
     catch
     {
         return(FontStretches.Normal);
     }
 }
Esempio n. 2
0
        public static FontStretch GetFontStretchFromInvariantStringOrNormal(string value)
        {
            if (value == null)
            {
                return(FontStretches.Normal);
            }

            try
            {
                return((FontStretch)_fontStretchConverter.ConvertFromInvariantString(value));
            }
            catch (NotSupportedException e)
            {
                Log.Exception($"Can't convert {value} to FontStretch", e, MethodBase.GetCurrentMethod().DeclaringType);
                return(FontStretches.Normal);
            }
        }