Ejemplo n.º 1
0
        internal void AddMemberToGroup(NodeSearchElementViewModel memberNode)
        {
            string categoryWithGroup = AddGroupToCategory(memberNode.Model.FullCategoryName,
                memberNode.Model.Group);
            string shortenedCategory = Nodes.Utilities.ShortenCategoryName(categoryWithGroup);

            var group = memberGroups.FirstOrDefault(mg => mg.FullyQualifiedName == shortenedCategory);
            if (group == null)
            {
                group = new SearchMemberGroup(shortenedCategory, memberNode.Category);
                memberGroups.Add(group);
            }

            group.AddMember(memberNode);
        }
Ejemplo n.º 2
0
        internal void AddMemberToGroup(NodeSearchElementViewModel memberNode)
        {
            string categoryWithGroup = AddGroupToCategory(memberNode.Model.FullCategoryName,
                                                          memberNode.Model.Group);
            string shortenedCategory = Nodes.Utilities.ShortenCategoryName(categoryWithGroup);

            var group = memberGroups.FirstOrDefault(mg => mg.FullyQualifiedName == shortenedCategory);

            if (group == null)
            {
                group = new SearchMemberGroup(shortenedCategory, memberNode.Category);
                memberGroups.Add(group);
            }

            group.AddMember(memberNode);
        }
Ejemplo n.º 3
0
        public void PrefixTest()
        {
            var memberGroup = new SearchMemberGroup(null);
            Assert.AreEqual(string.Empty, memberGroup.Prefix);

            memberGroup = new SearchMemberGroup(string.Empty);
            Assert.AreEqual(string.Empty, memberGroup.Prefix);

            var delimiter = Configurations.CategoryDelimiterWithSpaces;
            var fullyQualifiedName = "Builtin Functions" + delimiter + "Actions";

            memberGroup = new SearchMemberGroup(fullyQualifiedName);
            Assert.AreEqual(string.Empty, memberGroup.Prefix);

            fullyQualifiedName = "1stCategory" + delimiter +
                                 "2ndCategory" + delimiter +
                                 "3rdCategory" + delimiter + "Create";

            memberGroup = new SearchMemberGroup(fullyQualifiedName);
            Assert.AreEqual("2ndCategory" + delimiter +
                            "3rdCategory" + delimiter, memberGroup.Prefix);
        }
Ejemplo n.º 4
0
        private void UpdateTopResult(SearchMemberGroup memberGroup)
        {
            if (memberGroup == null)
            {
                TopResult = null;
                return;
            }

            var topMemberGroup = new SearchMemberGroup(memberGroup.FullyQualifiedName);
            topMemberGroup.AddMember(memberGroup.Members.First());

            TopResult = topMemberGroup;
        }
Ejemplo n.º 5
0
        private void UpdateTopResult(SearchMemberGroup memberGroup)
        {
            if (memberGroup == null)
            {
                TopResult = null;
                return;
            }

            var topMemberGroup = new SearchMemberGroup(memberGroup.FullyQualifiedName);

            // Clone top node.
            var topNode = new NodeSearchElementViewModel(memberGroup.Members.FirstOrDefault());
            topNode.IsSelected = true;            

            topMemberGroup.AddMember(topNode);
            TopResult = topMemberGroup;

            selectionNavigator.UpdateRootCategories(SearchRootCategories, topNode);            
        }