Esempio n. 1
0
        internal static async Task <MiddlewareData> RouteAsync(MiddlewareData Data)
        {
            for (int j = (int)MiddlewarePriority.Crital; j <= (int)MiddlewarePriority.Low; j++)
            {
                MiddlewarePriority p = (MiddlewarePriority)j;
                if (Middlewares.ContainsKey(p))
                {
                    for (int i = 0; i < Middlewares[p].Count; i++)
                    {
                        var Middleware = Middlewares[p][i];
                        try
                        {
                            var data = await Middleware.Start(Data);

                            if (data != null)
                            {
                                Data = data;
                            }
                            if (data.IsAbort)
                            {
                                return(data);
                            }
                        }
                        catch (Exception ex) { throw new MiddlewareException(Middleware, ex); }
                    }
                }
            }
            return(Data);
        }
Esempio n. 2
0
 public ModuleDataAlloc(MiddlewareData Data)
 {
     Path = Data.Path; STR_LANG = Data.STR_LANG; Context = Data.Context; ExtraData = Data.ExtraData;
 }