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; }
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)); }
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); }
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()); }
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()); }
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(); }
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(); }