Пример #1
0
        public Title(string title)
        {
            if (String.IsNullOrWhiteSpace(title))
            {
                this.title = Titles.Unknown;
                return;
            }

            try
            {
                this.title = (Titles)Enum.Parse(typeof(Titles), title.Trim('.'), IgnoreCase);
                this.title.GetDescription(); //catch int value outside the allowed range
            }
            catch (Exception)
            {
                this.title = Titles.Unknown;
            }
        }