コード例 #1
0
ファイル: WorkerBase.cs プロジェクト: pedrolimajesus/template
        protected bool ValidateMethodSignature(RouteKinds kind, MethodInfo mi)
        {
            switch (kind)
            {
            case RouteKinds.Decide:
                if (!DelegateCheck.IsCompatible(DecideType, mi))
                {
                    throw new ArgumentException(string.Format("method {0}.{1} does note have the required method signature", _actualType.Name, mi.Name));
                }
                break;

            case RouteKinds.Guard:
                if (!DelegateCheck.IsCompatible(GuardType, mi))
                {
                    throw new ArgumentException(string.Format("method {0}.{1} does note have the required method signature", _actualType.Name, mi.Name));
                }
                break;

            case RouteKinds.Invoke:
                if (!DelegateCheck.IsCompatible(InvokeType, mi))
                {
                    throw new ArgumentException(string.Format("method {0}.{1} does note have the required method signature", _actualType.Name, mi.Name));
                }
                break;

            default:
                break;
            }

            return(true);
        }
コード例 #2
0
ファイル: WorkerBase.cs プロジェクト: pedrolimajesus/template
        public virtual IEnumerable <string> ListRoutes(RouteKinds kinds = RouteKinds.All)
        {
            var routes = Enumerable.Empty <string>();

            if (kinds.HasFlag(RouteKinds.Invoke))
            {
                routes = routes.Concat(_invokes.Keys);
            }

            if (kinds.HasFlag(RouteKinds.Guard))
            {
                routes = routes.Concat(_guards.Keys);
            }

            if (kinds.HasFlag(RouteKinds.Decide))
            {
                routes = routes.Concat(_decides.Keys);
            }

            return(routes);
        }
コード例 #3
0
ファイル: WorkerBase.cs プロジェクト: pedrolimajesus/template
 public ExposeRouteAttribute(RouteKinds kind)
 {
     Kind          = kind;
     RouteEndPoint = null;
 }
コード例 #4
0
ファイル: WorkerBase.cs プロジェクト: pedrolimajesus/template
 public ExposeRouteAttribute(RouteKinds kind, string routeEndPoint)
 {
     Kind          = kind;
     RouteEndPoint = routeEndPoint;
 }