コード例 #1
0
        public static IActionSpec GetOverloadedAction(string actionName, ITypeSpec spec) {
            IActionSpec action = null;
            IActionSpec[] actions = spec.GetActionLeafNodes();
            Tuple<IActionSpec, string>[] overloadedActions = GetOverloadedActionsAndUIds(actions);

            if (overloadedActions.Any()) {
                Tuple<IActionSpec, string> matchingAction = overloadedActions.SingleOrDefault(oa => oa.Item1.Id + oa.Item2 == actionName);
                if (matchingAction != null) {
                    action = matchingAction.Item1;
                }
            }
            return action;
        }
コード例 #2
0
        public static Tuple <IActionSpec, string> GetActionandUidFromSpec(ITypeSpec spec, string actionName, string typeName)
        {
            IActionSpec[] actions = spec.GetActionLeafNodes();
            IActionSpec   action  = actions.SingleOrDefault(p => p.Id == actionName) ?? GetOverloadedAction(actionName, spec);

            if (action == null)
            {
                throw new TypeActionResourceNotFoundNOSException(actionName, typeName);
            }

            string uid = GetOverloadedUId(action, spec);

            return(new Tuple <IActionSpec, string>(action, uid));
        }
コード例 #3
0
        public static IActionSpec GetOverloadedAction(string actionName, ITypeSpec spec)
        {
            IActionSpec action = null;

            IActionSpec[] actions = spec.GetActionLeafNodes();
            Tuple <IActionSpec, string>[] overloadedActions = GetOverloadedActionsAndUIds(actions);

            if (overloadedActions.Any())
            {
                Tuple <IActionSpec, string> matchingAction = overloadedActions.SingleOrDefault(oa => oa.Item1.Id + oa.Item2 == actionName);
                if (matchingAction != null)
                {
                    action = matchingAction.Item1;
                }
            }
            return(action);
        }
コード例 #4
0
 public static Tuple <IActionSpec, string>[] GetActionsandUidFromSpec(ITypeSpec spec)
 {
     IActionSpec[] actions = spec.GetActionLeafNodes();
     return(actions.Select(action => new Tuple <IActionSpec, string>(action, GetOverloadedUId(action, spec))).ToArray());
 }
コード例 #5
0
 public static string GetOverloadedUId(IActionSpec action, ITypeSpec spec)
 {
     IActionSpec[] actions = spec.GetActionLeafNodes();
     Tuple <IActionSpec, string>[] overloadedActions = GetOverloadedActionsAndUIds(actions);
     return(overloadedActions.Where(oa => oa.Item1 == action).Select(oa => oa.Item2).SingleOrDefault());
 }
コード例 #6
0
 public static Tuple<IActionSpec, string>[] GetActionsandUidFromSpec(ITypeSpec spec) {
     IActionSpec[] actions = spec.GetActionLeafNodes();
     return actions.Select(action => new Tuple<IActionSpec, string>(action, GetOverloadedUId(action, spec))).ToArray();
 }
コード例 #7
0
 public static string GetOverloadedUId(IActionSpec action, ITypeSpec spec) {
     IActionSpec[] actions = spec.GetActionLeafNodes();
     Tuple<IActionSpec, string>[] overloadedActions = GetOverloadedActionsAndUIds(actions);
     return overloadedActions.Where(oa => oa.Item1 == action).Select(oa => oa.Item2).SingleOrDefault();
 }