Ejemplo n.º 1
0
        public static ProductException Create(Application app, int code, bool error, Exception innerException, Mono.Cecil.ICustomAttributeProvider provider, Instruction instruction, string message, params object [] args)
        {
            if (provider is Mono.Cecil.MemberReference member)
            {
                if (instruction != null)
                {
                    return(Create(app, code, error, innerException, member, instruction, message, args));
                }
                return(Create(app, code, error, innerException, member, null, message, args));
            }

            if (provider is Mono.Cecil.TypeReference type)
            {
                return(Create(app, code, error, innerException, type, message, args));
            }

            return(new ProductException(code, error, innerException, message, args));
        }
Ejemplo n.º 2
0
 public static ProductException Create(Application app, int code, bool error, Exception innerException, Mono.Cecil.ICustomAttributeProvider provider, string message, params object [] args)
 {
     return(Create(app, code, error, innerException, provider, null, message, args));
 }
Ejemplo n.º 3
0
 public static bool HasAttribute <T>(this Mono.Cecil.ICustomAttributeProvider type) where T : Attribute
 {
     return(type.CustomAttributes.Any(a => a.AttributeType.FullName == typeof(T).FullName));
 }
Ejemplo n.º 4
0
 public static ProductException CreateWarning(Application app, int code, Mono.Cecil.ICustomAttributeProvider provider, string message, params object [] args)
 {
     return(Create(app, code, false, null, provider, message, args));
 }
Ejemplo n.º 5
0
 public static Mono.Cecil.CustomAttribute GetAttribute <T>(this Mono.Cecil.ICustomAttributeProvider type)
     where T : Attribute
 {
     return(type.CustomAttributes.Where(a => a.AttributeType.FullName == typeof(T).FullName).FirstOrDefault());
 }