Example #1
0
        protected override DropdownElement RebuildTree()
        {
            GroupDropdownElement groupDropdownElement = new GroupDropdownElement(this.m_Label);

            for (int i = 0; i < this.m_DisplayedOptions.Length; i++)
            {
                string   text  = this.m_DisplayedOptions[i];
                string[] array = text.Split(new char[]
                {
                    '/'
                });
                DropdownElement dropdownElement = groupDropdownElement;
                for (int j = 0; j < array.Length; j++)
                {
                    string name = array[j];
                    if (j == array.Length - 1)
                    {
                        SearchableDropdownElement searchableDropdownElement = new SearchableDropdownElement(name, text, i);
                        searchableDropdownElement.SetParent(dropdownElement);
                        dropdownElement.AddChild(searchableDropdownElement);
                        if (i == AdvancedDropdown.m_SelectedIndex)
                        {
                            DropdownElement dropdownElement2 = dropdownElement;
                            DropdownElement item             = searchableDropdownElement;
                            while (dropdownElement2 != null)
                            {
                                dropdownElement2.selectedItem = dropdownElement2.children.IndexOf(item);
                                item             = dropdownElement2;
                                dropdownElement2 = dropdownElement2.parent;
                            }
                        }
                    }
                    else
                    {
                        string groupPathId = "";
                        for (int k = 0; k <= j; k++)
                        {
                            groupPathId = groupPathId + array[k] + ".";
                        }
                        DropdownElement dropdownElement3 = dropdownElement.children.SingleOrDefault((DropdownElement c) => c.id == groupPathId);
                        if (dropdownElement3 == null)
                        {
                            dropdownElement3 = new GroupDropdownElement(name, groupPathId);
                            dropdownElement3.SetParent(dropdownElement);
                            dropdownElement.AddChild(dropdownElement3);
                        }
                        dropdownElement = dropdownElement3;
                    }
                }
            }
            return(groupDropdownElement);
        }
Example #2
0
        protected override DropdownElement RebuildTree()
        {
            DropdownElement dropdownElement = new DropdownElement("ROOT");

            string[] submenus         = Unsupported.GetSubmenus("Component");
            string[] submenusCommands = Unsupported.GetSubmenusCommands("Component");
            for (int i = 0; i < submenus.Length; i++)
            {
                if (!(submenusCommands[i] == "ADD"))
                {
                    string   text  = submenus[i];
                    string[] array = text.Split(new char[]
                    {
                        '/'
                    });
                    DropdownElement dropdownElement2 = dropdownElement;
                    for (int j = 0; j < array.Length; j++)
                    {
                        string path = array[j];
                        if (j == array.Length - 1)
                        {
                            ComponentDropdownElement componentDropdownElement = new ComponentDropdownElement(LocalizationDatabase.GetLocalizedString(path), text, submenusCommands[i]);
                            componentDropdownElement.SetParent(dropdownElement2);
                            dropdownElement2.AddChild(componentDropdownElement);
                        }
                        else
                        {
                            DropdownElement dropdownElement3 = dropdownElement2.children.SingleOrDefault((DropdownElement c) => c.name == path);
                            if (dropdownElement3 == null)
                            {
                                dropdownElement3 = new GroupDropdownElement(path);
                                dropdownElement3.SetParent(dropdownElement2);
                                dropdownElement2.AddChild(dropdownElement3);
                            }
                            dropdownElement2 = dropdownElement3;
                        }
                    }
                }
            }
            dropdownElement = dropdownElement.children.Single <DropdownElement>();
            dropdownElement.SetParent(null);
            GroupDropdownElement groupDropdownElement = new GroupDropdownElement("New script");

            groupDropdownElement.AddChild(new NewScriptDropdownElement());
            groupDropdownElement.SetParent(dropdownElement);
            dropdownElement.AddChild(groupDropdownElement);
            return(dropdownElement);
        }
Example #3
0
        protected override DropdownElement RebuildSearch()
        {
            DropdownElement dropdownElement = base.RebuildSearch();

            if (dropdownElement != null)
            {
                GroupDropdownElement     groupDropdownElement     = new GroupDropdownElement("New script");
                NewScriptDropdownElement newScriptDropdownElement = new NewScriptDropdownElement();
                newScriptDropdownElement.className = this.m_Search;
                groupDropdownElement.AddChild(newScriptDropdownElement);
                newScriptDropdownElement.SetParent(groupDropdownElement);
                groupDropdownElement.SetParent(dropdownElement);
                dropdownElement.AddChild(groupDropdownElement);
            }
            return(dropdownElement);
        }