Пример #1
0
        public SplitNode(Split split)
        {
            Split = split;
            _nameNode = new EditableNode("Name", split.Name, NameChanged);

            Nodes.Add(_nameNode);
            _bestNode = new EditableNode("Best", split.Best.NullableToString(), BestTimeChanged);
            Nodes.Add(_bestNode);

            _currentNode = new EditableNode("Current", split.Current.NullableToString(), CurrentTimeChanged);
            Nodes.Add(_currentNode);

            Render();
        }
Пример #2
0
        private void AddSplitAfterSelection(object sender, EventArgs e)
        {
            if (SelectedSplits == null)
                return;

            var newSplit = new Split()
            {
                Name = "New Split",
            };

            var selectedSplit = _treeEditor.GetSelectedSplit();
            if(selectedSplit != null)
            {
                SelectedSplits.Insert(SelectedSplits.IndexOf(selectedSplit) + 1, newSplit);
            }
            else
            {
                SelectedSplits.Insert(SelectedSplits.Count, newSplit);
            }
            SelectedSplits.Dirty = true;
            Render();
        }