public virtual JsonResult GetActionCompletions(string id, string actionName, int parameterIndex, string autoCompleteParm) { INakedObject nakedObject = NakedObjectsContext.GetNakedObjectFromId(id); IActionSpec action = NakedObjectsContext.GetActions(nakedObject).SingleOrDefault(a => a.Id == actionName); IList <object> completions = new List <object>(); IActionParameterSpec p = action.Parameters[parameterIndex]; if (p.IsAutoCompleteEnabled) { INakedObject[] nakedObjectCompletions = p.GetCompletions(nakedObject, autoCompleteParm); completions = nakedObjectCompletions.Select(no => GetCompletionData(no, p.Spec)).ToList(); } return(Jsonp(completions)); }
public ITestNaked[] GetCompletions(string autoCompleteParm) { return(parameterSpec.GetCompletions(NakedObject, autoCompleteParm).Select(x => factory.CreateTestNaked(x)).ToArray()); }
public INakedObjectSurface[] GetCompletions(INakedObjectSurface nakedObject, string autoCompleteParm) { return(nakedObjectActionParameter.GetCompletions(((NakedObjectWrapper)nakedObject).WrappedNakedObject, autoCompleteParm).Select(no => NakedObjectWrapper.Wrap(no, Surface, framework)).Cast <INakedObjectSurface>().ToArray()); }
public IObjectFacade[] GetCompletions(IObjectFacade objectFacade, string autoCompleteParm) { return(nakedObjectActionParameter.GetCompletions(((ObjectFacade)objectFacade).WrappedNakedObject, autoCompleteParm).Select(no => ObjectFacade.Wrap(no, FrameworkFacade, framework)).Cast <IObjectFacade>().ToArray()); }