Пример #1
0
        public void AddChildren(List <HtmlNode> FlatList, HtmlNode CurrentNode, int CurrentIndex)
        {
            Node Node;
            int  CurrentLevel = GetHeaderLevel(CurrentNode);

            if (CurrentLevel > HeaderLevel)
            {
                Node = new Node(this, CurrentNode);

                if (CurrentIndex >= FlatList.Count - 1)
                {
                    return;
                }

                CurrentIndex++;
                CurrentNode = FlatList[CurrentIndex];
                Node.AddChildren(FlatList, CurrentNode, CurrentIndex);
            }
            else if (CurrentLevel <= this.HeaderLevel)
            {
                if (Parent == null)
                {
                    throw new ApplicationException("No parent");
                }

                Parent.AddChildren(FlatList, CurrentNode, CurrentIndex);
            }
        }
Пример #2
0
 private void ColorPicker_MouseClick(object sender, Input.MouseEventArgs e)
 {
     if (e.Button == Input.MouseButton.Left)
     {
         Parent?.AddChildren(_colorPickerBox);
         _colorPickerBox.ColorSelectedIndex += ColorPickerBox_Selected;
     }
 }