Пример #1
0
 public PromptInfo(
     string name
     , string label
     , PromptType promptType
     , PromptLevel topPromptLevel
     , IEnumerable<DefaultValue> defaultValues)
 {
     Name = name;
     PromptLevelInfo = topPromptLevel;
     PromptType = promptType;
     Label = label;
     DefaultValues = defaultValues;
 }
        public ISearchablePromptItemCollection CreateSearchablePromptItems(string promptName, PromptLevel promptLevel)
        {
            var promptItems = new ObservableCollection<ISearchablePromptItem>();

            foreach (var availableItem in promptLevel.AvailableItems)
            {
                var promptItem = new SearchablePromptItem(promptName, promptLevel.ParameterName, availableItem, false);

                promptItems.Add(promptItem);
            }

            return new SearchablePromptItems(promptItems);
        }
Пример #3
0
 public PromptInfo(
     string name
     , string label
     , PromptType promptType
     , PromptLevel topPromptLevel
     , IEnumerable <DefaultValue> defaultValues)
 {
     Name            = name;
     PromptLevelInfo = topPromptLevel;
     PromptType      = promptType;
     Label           = label;
     DefaultValues   = defaultValues;
 }
        private void OnGetChildrenCompleted(
            PromptLevel response,
            string promptName,
            ITreeNode parentTreeNode,
            Action<ObservableCollection<ITreeNode>> callback)
        {
            var treeNodes = _treeNodeCollectionBuilder.BuildRegularNodesFrom(
                promptName
                , response.ParameterName
                , response.AvailableItems
                , parentTreeNode
                , response.HasChildLevel);

            callback(treeNodes);
        }
 public void RaiseGetChildrenCompleted(PromptLevel getChildrenResponse)
 {
     _callback(getChildrenResponse);
 }
Пример #6
0
 public PromptInfoBuilder WithPromptLevel(PromptLevel promptLevel)
 {
     _promptLevel = promptLevel;
     return this;
 }
Пример #7
0
        private void OnGetChildrenForCompleted2(
            PromptLevel getChildrenResponse,
            string promptName,
            Action<ISearchablePromptItemCollection> result)
        {
            var promptItems = _promptItemCollectionBuilder.CreateSearchablePromptItems(
                promptName,
                getChildrenResponse);

            result(promptItems);
        }
Пример #8
0
 public void ItSetsTheAvailableItemsToAnEmptyCollectionWhenTheValidValuesAreNull()
 {
     var promptLevel = new PromptLevel("ParameterName", null, false);
     Assert.AreEqual(0, promptLevel.AvailableItems.Count());
 }