コード例 #1
0
        private static bool IsSeveralAllowed(AcErrorType errorType)
        {
            var type    = typeof(AcErrorType);
            var memInfo = type.GetMember(errorType.ToString());

            return(memInfo[0].GetCustomAttributes(typeof(SeveralAllowedAttribute), false).Length > 0);
        }
コード例 #2
0
ファイル: AcError.cs プロジェクト: gro-ove/actools
        private static AcErrorCategory CategoryFromType(AcErrorType type) {
            AcErrorCategory result;
            if (Enum.TryParse(type.ToString().Split(new[] { '_' }, 2)[0], out result)) {
                return result;
            }

            Logging.Warning($"Can’t get category for AcErrorType: {type}");
            return AcErrorCategory.Unspecific;
        }
コード例 #3
0
ファイル: AcError.cs プロジェクト: tankyx/actools
        private static AcErrorCategory CategoryFromType(AcErrorType type)
        {
            AcErrorCategory result;

            if (Enum.TryParse(type.ToString().Split(new[] { '_' }, 2)[0], out result))
            {
                return(result);
            }

            Logging.Warning($"Can’t get category for AcErrorType: {type}");
            return(AcErrorCategory.Unspecific);
        }
コード例 #4
0
 private static bool IsSeveralAllowed(AcErrorType errorType) {
     var type = typeof(AcErrorType);
     var memInfo = type.GetMember(errorType.ToString());
     return memInfo[0].GetCustomAttributes(typeof(SeveralAllowedAttribute), false).Length > 0;
 }