Inheritance: System.Windows.Controls.TreeViewItem
示例#1
0
        public void ConfigurePartAdders(OutlineNode node, FixtureGraph fixture, IPartHolder holder)
        {
            var selector   = new OutlineGrammarSelector(node);
            var configurer = new GrammarSelectorConfigurer(holder, selector, _controller);

            configurer.Configure(fixture);
        }
        public OutlineNode BuildNode(Test test, IOutlineController controller)
        {
            var builder = this.builder(controller, test);

            _topNode = builder.Build();
            return _topNode;
        }
示例#3
0
        public OutlineNode BuildNode(Test test, IOutlineController controller)
        {
            var builder = this.builder(controller, test);

            _topNode = builder.Build();
            return(_topNode);
        }
示例#4
0
 public void ConfigureRearrangeCommands(OutlineNode node, IPartHolder holder, ITestPart part)
 {
     node.BindControlAnd(Key.Up).To(() => _controller.MoveUp(part, holder)).Menu("Move Up", Icon.UpArrow);
     node.BindControlAnd(Key.PageUp).To(() => _controller.MoveToTop(part, holder)).Menu("Move to Top", Icon.UpArrow);
     node.BindControlAnd(Key.Down).To(() => _controller.MoveDown(part, holder)).Menu("Move Down", Icon.DownArrow);
     node.BindControlAnd(Key.PageDown).To(() => _controller.MoveToBottom(part, holder)).Menu("Move to Bottom", Icon.DownArrow);
     node.Bind(Key.Delete).To(() => _controller.Remove(part, holder)).Menu("Delete", Icon.Delete);
 }
示例#5
0
        private void withNewLeaf(ITestPart part, Icon icon, Action <OutlineNode> configure)
        {
            var node = new OutlineNode(part, icon);

            configure(node);
            CurrentNode.Items.Add(node);
            LastNode = node;
        }
示例#6
0
        public OutlineNode Build()
        {
            var outlineNode = new OutlineNode(_test, Icon.Test);
            outlineNode.AddText(_test.Name);

            Rebuild(outlineNode);

            return _top;
        }
示例#7
0
        private void addRearrangeCommands(OutlineNode node)
        {
            if (CurrentNode.Icon == Icon.Paragraph)
            {
                return;
            }

            _configurer.ConfigureRearrangeCommands(node, CurrentNode.Holder, node.Part);
        }
示例#8
0
        public OutlineNode Build()
        {
            var outlineNode = new OutlineNode(_test, Icon.Test);

            outlineNode.AddText(_test.Name);

            Rebuild(outlineNode);

            return(_top);
        }
示例#9
0
        public OutlineGrammarSelector(OutlineNode node)
        {
            node.Bind(ModifierKeys.Alt, Key.Insert).To(() => IsOpen = true);

            StaysOpen = true;

            PlacementTarget  = node;
            VerticalOffset   = 5;
            HorizontalOffset = 20;
            Placement        = PlacementMode.RelativePoint;

            Add(Icon.Close, "Close", () => IsOpen = false, new KeyGesture(Key.Escape));
        }
示例#10
0
        public void Rebuild(OutlineNode topNode)
        {
            topNode.IsSelected = true;
            topNode.Items.Clear();
            _top = topNode;

            _nodes.Push(_top);
            LastNode = _top;

            var parser = new TestParser(_test, this, _library);

            parser.Parse();
        }
        public OutlineGrammarSelector(OutlineNode node)
        {
            node.Bind(ModifierKeys.Alt, Key.Insert).To(() => IsOpen = true);

            StaysOpen = true;

            PlacementTarget = node;
            VerticalOffset = 5;
            HorizontalOffset = 20;
            Placement = PlacementMode.RelativePoint;

            Add(Icon.Close, "Close", () => IsOpen = false, new KeyGesture(Key.Escape));
        }
示例#12
0
        public void StartTest(Test test)
        {
            if (_top == null)
            {
                _top = new OutlineNode(test, Icon.Test);
                _top.AddText(test.Name);
                LastNode = _top;
            }

            if (_nodes.Count == 0)
            {
                _nodes.Push(_top);
            }

            _configurer.ConfigureSectionAdder(_top, _library, _test);
        }
示例#13
0
        public void ConfigureSectionAdder(OutlineNode node, FixtureLibrary library, Test test)
        {
            var selector = new OutlineGrammarSelector(node);

            selector.Add(Icon.Comment, "Comment", () => _controller.AddComment(test), Key.C.ToGesture());

            int index = 0;

            library.ActiveFixtures.Each(x =>
            {
                if (index < Shortcuts.Length)
                {
                    selector.Add(Icon.Section, x.Label, () => _controller.AddSection(x.Name), Shortcuts[index++]);
                }
                else
                {
                    selector.Add(Icon.Section, x.Label, () => _controller.AddSection(x.Name), new KeyGesture(Key.F15));
                }
            });
        }
示例#14
0
        public void SelectNodeFor(ITestPart part)
        {
            //_topNode.Parent.CallOn<UIElement>(e => e.Focus());
            //moveNext();
            //moveNext();
            //moveNext();
            //moveNext();
            //moveNext();

            _topNode.IsSelected = false;
            var parent = _topNode.Parent as UIElement;

            parent.Focus();
            parent.InvalidateVisual();
            OutlineNode node = _topNode.Find(n => n.Part == part);

            node.BringIntoView();
            node.IsSelected = true;
            node.Focus();
            //node.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
            //moveNext();
            return;


            //_topNode.Parent.CallOn<UIElement>(e => e.Focus());

            node.Focus();

            //parent.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
            //Keyboard.FocusedElement.As<UIElement>().MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
            //Keyboard.FocusedElement.As<UIElement>().MoveFocus(new TraversalRequest(FocusNavigationDirection.Previous));

            //node.IsSelected = true;
            //node.Focus();
            //_topNode.Parent.CallOn<UIElement>(e => e.Focus());
        }
示例#15
0
        public void WriteSentenceText(OutlineNode node, Sentence sentence, IStep step)
        {
            var writer = new SentenceWriter(node, step);

            sentence.Parts.Each(x => x.AcceptVisitor(writer));
        }
示例#16
0
 public void ResetTree(OutlineNode node)
 {
     tree.Items.Clear();
     tree.Items.Add(node);
     node.IsSelected = true;
 }
 public void ConfigurePartAdders(OutlineNode node, FixtureStructure fixture, IPartHolder holder)
 {
     var selector = new OutlineGrammarSelector(node);
     var configurer = new GrammarSelectorConfigurer(holder, selector, _controller);
     configurer.Configure(fixture);
 }
示例#18
0
 public void ConfigureTableColumnSelector(OutlineNode node, Table table, IStep step)
 {
     // no-op
 }
示例#19
0
 private void withNewNode(ITestPart part, Icon icon, Action<OutlineNode> configure)
 {
     var node = new OutlineNode(part, icon);
     configure(node);
     CurrentNode.Items.Add(node);
     LastNode = node;
     _nodes.Push(node);
 }
 public void WriteSentenceText(OutlineNode node, Sentence sentence, IStep step)
 {
     var writer = new SentenceWriter(node, step);
     sentence.Parts.Each(x => x.AcceptVisitor(writer));
 }
示例#21
0
        public void StartTest(Test test)
        {
            if (_top == null)
            {
                _top = new OutlineNode(test, Icon.Test);
                _top.AddText(test.Name);
                LastNode = _top;
            }

            if (_nodes.Count == 0)
            {
                _nodes.Push(_top);
            }

            _configurer.ConfigureSectionAdder(_top, _library, _test);
        }
示例#22
0
        private void addRearrangeCommands(OutlineNode node)
        {
            if (CurrentNode.Icon == Icon.Paragraph) return;

            _configurer.ConfigureRearrangeCommands(node, CurrentNode.Holder, node.Part);
        }
示例#23
0
        public void Rebuild(OutlineNode topNode)
        {
            topNode.IsSelected = true;
            topNode.Items.Clear();
            _top = topNode;

            _nodes.Push(_top);
            LastNode = _top;

            var parser = new TestParser(_test, this, _library);
            parser.Parse();
        }
示例#24
0
 public void ResetTree(OutlineNode node)
 {
     tree.Items.Clear();
     tree.Items.Add(node);
     node.IsSelected = true;
 }
        public void ConfigureSectionAdder(OutlineNode node, FixtureLibrary library, Test test)
        {
            var selector = new OutlineGrammarSelector(node);
            selector.Add(Icon.Comment, "Comment", () => _controller.AddComment(test), Key.C.ToGesture());

            int index = 0;
            library.ActiveFixtures.Each(x =>
            {
                if (index < Shortcuts.Length)
                {
                    selector.Add(Icon.Section, x.Label, () => _controller.AddSection(x.Name), Shortcuts[index++]);
                }
                else
                {
                    selector.Add(Icon.Section, x.Label, () => _controller.AddSection(x.Name), new KeyGesture(Key.F15));
                }
            });
        }
示例#26
0
 public SentenceWriter(OutlineNode node, IStep step)
 {
     _node = node;
     _step = step;
 }
 public void ConfigureRearrangeCommands(OutlineNode node, IPartHolder holder, ITestPart part)
 {
     node.BindControlAnd(Key.Up).To(() => _controller.MoveUp(part, holder)).Menu("Move Up", Icon.UpArrow);
     node.BindControlAnd(Key.PageUp).To(() => _controller.MoveToTop(part, holder)).Menu("Move to Top", Icon.UpArrow);
     node.BindControlAnd(Key.Down).To(() => _controller.MoveDown(part, holder)).Menu("Move Down", Icon.DownArrow);
     node.BindControlAnd(Key.PageDown).To(() => _controller.MoveToBottom(part, holder)).Menu("Move to Bottom", Icon.DownArrow);
     node.Bind(Key.Delete).To(() => _controller.Remove(part, holder)).Menu("Delete", Icon.Delete);
 }
 public SentenceWriter(OutlineNode node, IStep step)
 {
     _node = node;
     _step = step;
 }
 public void ConfigureTableColumnSelector(OutlineNode node, Table table, IStep step)
 {
     // no-op
 }