public BaseGroupElement GetOrCreateGroup(string path) { if (path == "") { return(Root); } s_Separators[0] = config.Separator; var parts = path.Split(s_Separators, StringSplitOptions.None); BaseGroupElement groupElement = Root; string currentPath = ""; for (int i = 0; i < parts.Length; i++) { var title = parts[i]; currentPath += title; groupElement.OnBeforeContentNeeded(this); bool any = false; for (int j = 0; j < groupElement.Children.Count; j++) { var child = groupElement.Children[j]; if (child.Title == title && child is BaseGroupElement) { groupElement = (BaseGroupElement)child; any = true; break; } } if (!any) { var g = new GroupElement(title, null); groupElement.Children.Add(g); groupElement = g; } currentPath += config.Separator; } return(groupElement); }
/// <summary> Создание окна </summary> public Popup(IPopupConfig config) { this.config = config; Root = new GroupElement(config.RootName, null); Search = new GroupElement("Search", null); }