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); }
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); }
private void UpdateTopResult(SearchMemberGroup memberGroup) { if (memberGroup == null) { TopResult = null; return; } var topMemberGroup = new SearchMemberGroup(memberGroup.FullyQualifiedName); topMemberGroup.AddMember(memberGroup.Members.First()); TopResult = topMemberGroup; }
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); }