IrcD.Server.Settings.GetCaseMapping C# (CSharp) Method

GetCaseMapping() private method

private GetCaseMapping ( ) : IrcCaseMapping
return IrcCaseMapping
        private IrcCaseMapping GetCaseMapping()
        {
            var mode = _configFile.Descendants("case_mapping").Select(m => m.Value).FirstOrDefault();

            if (mode == default(string))
                return IrcCaseMapping.Ascii;

            #if NET4
            IrcCaseMapping result;
            if (Enum.TryParse(mode, true, out result))
            {
                return result;
            }
            return IrcCaseMapping.Ascii;
            #else
            try
            {
                return (IrcCaseMapping)Enum.Parse(typeof(IrcCaseMapping), mode, true);
            }
            catch (ArgumentException)
            {
                return IrcCaseMapping.Ascii;
            }
            #endif
        }