public static NakedObjectActionParameter[] GetParameters(this ActionWrapper action, NakedReference obj) { var parms = new List<NakedObjectActionParameter>(); NakedObjectSpecification[] parameterTypes = action.getParameterTypes(); int index = 0; ActionParameterSet set = action.getParameterSet(obj); foreach (NakedObjectSpecification nakedObjectSpecification in parameterTypes) { string name = (set == null ? GetShortName(nakedObjectSpecification) : set.getParameterLabels()[index] ?? GetShortName(nakedObjectSpecification)); object[] choices = set == null ? null : set.getOptions()[index]; object dflt = set == null ? null : set.getDefaultParameterValues()[index]; parms.Add(new NakedObjectActionParameter(name, index++, nakedObjectSpecification, action, choices, dflt)); } return parms.ToArray(); }
public Consent isVisible(NakedReference target) { MethodInfo m = action.GetType().GetMethod("isVisible"); return((Consent)m.Invoke(action, new object[] { target })); }
public ActionParameterSet getParameterSet(NakedReference @object) { MethodInfo m = action.GetType().GetMethod("getParameterSet"); return((ActionParameterSet)m.Invoke(action, new object[] { @object })); }
public Consent isParameterSetValid(NakedReference @object, Naked[] parameters) { MethodInfo m = action.GetType().GetMethod("isParameterSetValid"); return((Consent)m.Invoke(action, new object[] { @object, parameters })); }
public Naked execute(NakedReference target, Naked[] parameters) { MethodInfo m = action.GetType().GetMethod("execute"); return((Naked)m.Invoke(action, new object[] { target, parameters })); }
public static NakedObjectActionParameter[] GetParameters(this ActionWrapper action, NakedReference obj) { var parms = new List <NakedObjectActionParameter>(); NakedObjectSpecification[] parameterTypes = action.getParameterTypes(); int index = 0; ActionParameterSet set = action.getParameterSet(obj); foreach (NakedObjectSpecification nakedObjectSpecification in parameterTypes) { string name = (set == null ? GetShortName(nakedObjectSpecification) : set.getParameterLabels()[index] ?? GetShortName(nakedObjectSpecification)); object[] choices = set == null ? null : set.getOptions()[index]; object dflt = set == null ? null : set.getDefaultParameterValues()[index]; parms.Add(new NakedObjectActionParameter(name, index++, nakedObjectSpecification, action, choices, dflt)); } return(parms.ToArray()); }