コード例 #1
0
        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));
        }
コード例 #2
0
 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());
 }
コード例 #4
0
 public IObjectFacade[] GetCompletions(IObjectFacade objectFacade, string autoCompleteParm)
 {
     return(nakedObjectActionParameter.GetCompletions(((ObjectFacade)objectFacade).WrappedNakedObject, autoCompleteParm).Select(no => ObjectFacade.Wrap(no, FrameworkFacade, framework)).Cast <IObjectFacade>().ToArray());
 }