public IEnumerable <EditorDataItem> GetEditorDataItems([FromUri] int contextId, [FromUri] string propertyAlias, [FromBody] dynamic data) { XmlDataSource xmlDataSource = ((JObject)data.config.dataSource).ToObject <XmlDataSource>(); IEnumerable <EditorDataItem> editorDataItems = xmlDataSource.GetEditorDataItems(contextId); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); TypeaheadListPicker typeaheadListPicker = new TypeaheadListPicker((string)data.typeahead); // process the labels and then handle any type ahead text return(typeaheadListPicker.ProcessEditorDataItems(customLabel.ProcessEditorDataItems(editorDataItems))); }
public IEnumerable <EditorDataItem> GetEditorDataItems([FromUri] int contextId, [FromUri] int parentId, [FromUri] string propertyAlias, [FromBody] dynamic data) { DotNetDataSource dotNetDataSource = ((JObject)data.config.dataSource).ToObject <DotNetDataSource>(); dotNetDataSource.Typeahead = (string)data.typeahead; IEnumerable <EditorDataItem> editorDataItems = dotNetDataSource.GetEditorDataItems(contextId, parentId).ToList(); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); editorDataItems = customLabel.ProcessEditorDataItems(editorDataItems); // if the typeahead wasn't handled by the custom data-source, then fallback to default typeahead processing if (!dotNetDataSource.HandledTypeahead) { TypeaheadListPicker typeaheadListPicker = new TypeaheadListPicker((string)data.typeahead); editorDataItems = typeaheadListPicker.ProcessEditorDataItems(editorDataItems); } return(editorDataItems); }