示例#1
0
 private static uint?ID(IMiddleware MiddleWare)
 {
     Attribute[] attrs = Attribute.GetCustomAttributes(MiddleWare.GetType());
     foreach (Attribute attr in attrs)
     {
         if (attr is MiddlewareAttribute)
         {
             MiddlewareAttribute mw = (MiddlewareAttribute)attr;
             return(mw.ID);
         }
     }
     return(null);
 }
示例#2
0
        internal MiddlewareException(IMiddleware Middleware, Exception innerException) : base(innerException.Message, innerException)
        {
            this.Middleware = Middleware;

            var type = Middleware.GetType();

            this.Tag = type.Name;

            var attrs = type.GetCustomAttributes(Web.Middleware.Middleware.AttributeType, true);

            Attribute = new MiddlewareAttribute[attrs.Length];
            for (int i = 0; i < Attribute.Length; i++)
            {
                Attribute[i] = (MiddlewareAttribute)attrs[i];
            }
        }