상속: 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);
        }
예제 #2
0
        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;
 }
예제 #17
0
 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);
 }
예제 #20
0
 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;
 }
예제 #25
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));
                }
            });
        }
예제 #26
0
 public SentenceWriter(OutlineNode node, IStep step)
 {
     _node = node;
     _step = step;
 }
예제 #27
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);
 }
예제 #28
0
 public SentenceWriter(OutlineNode node, IStep step)
 {
     _node = node;
     _step = step;
 }
예제 #29
0
 public void ConfigureTableColumnSelector(OutlineNode node, Table table, IStep step)
 {
     // no-op
 }