当前位置: 首页>>代码示例>>C#>>正文


C# MapNode.AddToSelection方法代码示例

本文整理汇总了C#中MindMate.Model.MapNode.AddToSelection方法的典型用法代码示例。如果您正苦于以下问题:C# MapNode.AddToSelection方法的具体用法?C# MapNode.AddToSelection怎么用?C# MapNode.AddToSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MindMate.Model.MapNode的用法示例。


在下文中一共展示了MapNode.AddToSelection方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddToSelection

        public void AddToSelection()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "C");
            var c11 = new MapNode(c1, "6");
            var c12 = new MapNode(c1, "2");
            var c121 = new MapNode(c12, "c121");
            var c13 = new MapNode(c1, "4");
            var c14 = new MapNode(c1, "7");
            var c15 = new MapNode(c1, "1");
            var c16 = new MapNode(c1, "5");
            var c17 = new MapNode(c1, "3");
            var c2 = new MapNode(r, "B");
            var c3 = new MapNode(r, "C", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c32 = new MapNode(c3, "c32");

            r.AddToSelection();
            c1.AddToSelection();

            Assert.AreEqual(2, r.Tree.SelectedNodes.Count);
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例2: ApplyNodeStyle

        public void ApplyNodeStyle()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            r.FontSize = 15;
            var c1 = new MapNode(r, "c1");
            var c2 = new MapNode(r, "c2");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();
            var style = mapCtrl.CreateNodeStyle();
            r.Selected = false;
            c1.AddToSelection();
            c2.AddToSelection();

            mapCtrl.ApplyNodeStyle(style);

            Assert.AreEqual(15, c1.FontSize);
            Assert.AreEqual(15, c2.FontSize);
        }
开发者ID:,项目名称:,代码行数:24,代码来源:

示例3: ChangeBackColor

        public void ChangeBackColor()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            r.FontSize = 15;
            var c1 = new MapNode(r, "c1");
            var c2 = new MapNode(r, "c2");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();

            mapCtrl.ChangeBackColor(Color.Aqua);

            c2.AddToSelection();

            Assert.AreEqual(c1.BackColor, Color.Empty);
            Assert.AreEqual(c2.BackColor, Color.Empty);
            Assert.AreEqual(r.BackColor, Color.Aqua);
        }
开发者ID:,项目名称:,代码行数:23,代码来源:

示例4: CreateNodeStyle_NullIfMultipleSelected

        public void CreateNodeStyle_NullIfMultipleSelected()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            var c1 = new MapNode(r, "c1");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();
            c1.AddToSelection();

            var style = mapCtrl.CreateNodeStyle();

            Assert.IsNull(style);
        }
开发者ID:,项目名称:,代码行数:18,代码来源:

示例5: ClearNodeShape

        public void ClearNodeShape()
        {
            MapCtrl mapCtrl = SetupMapCtrlWithEmptyTree();
            var t = mapCtrl.MapView.Tree;
            var r = t.RootNode;
            var c1 = new MapNode(r, "c1");
            var c11 = new MapNode(c1, "c11");
            var c12 = new MapNode(c1, "c12");
            var c13 = new MapNode(c1, "c13");
            var c131 = new MapNode(c13, "c131");
            var c2 = new MapNode(r, "c2");
            var c3 = new MapNode(r, "c3", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c311 = new MapNode(c31, "c311");
            var c3111 = new MapNode(c311, "c3111");
            var c32 = new MapNode(c3, "c32");
            c32.AddToSelection();
            c3111.AddToSelection();
            mapCtrl.ClearNodeShape();

            Assert.AreEqual(NodeShape.None, c32.Shape);
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例6: CreateNodeStyle_NodeStylesCountGoesUp

        public void CreateNodeStyle_NodeStylesCountGoesUp()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            A.CallTo(() => mainCtrl.ShowInputBox("Enter the style name:", null)).Returns(DateTime.Now.Ticks.ToString());
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();
            int count = MetaModel.MetaModel.Instance.NodeStyles.Count;

            mapCtrl.CreateNodeStyle();

            Assert.AreEqual(count + 1, MetaModel.MetaModel.Instance.NodeStyles.Count);
        }
开发者ID:,项目名称:,代码行数:18,代码来源:

示例7: ChangeNodeShape_StringParameter

        public void ChangeNodeShape_StringParameter()
        {
            MapCtrl mapCtrl = SetupMapCtrlWithEmptyTree();
            var t = mapCtrl.MapView.Tree;
            var r = t.RootNode;
            var c1 = new MapNode(r, "c1");
            var c11 = new MapNode(c1, "c11");
            var c12 = new MapNode(c1, "c12");
            var c13 = new MapNode(c1, "c13");
            var c131 = new MapNode(c13, "c131");
            var c2 = new MapNode(r, "c2");
            var c3 = new MapNode(r, "c3", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c311 = new MapNode(c31, "c311");
            var c3111 = new MapNode(c311, "c3111");
            var c32 = new MapNode(c3, "c32");
            c32.AddToSelection();

            mapCtrl.ChangeNodeShape("Bubble");

            Assert.AreEqual(NodeShape.Bubble, c32.Shape);
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例8: ChangeStrikeout_MultiSelect

        public void ChangeStrikeout_MultiSelect()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            r.FontSize = 15;
            var c1 = new MapNode(r, "c1");
            var c2 = new MapNode(r, "c2");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();
            c2.AddToSelection();
            c2.Strikeout = true;
            mapCtrl.ChangeStrikeout(false);

            Assert.IsFalse(c2.Strikeout);
            Assert.IsFalse(r.Strikeout);
        }
开发者ID:,项目名称:,代码行数:21,代码来源:

示例9: ChangeNodeShapeBullet_ChangeManagerUndoCount

        public void ChangeNodeShapeBullet_ChangeManagerUndoCount()
        {
            MapCtrl mapCtrl = SetupMapCtrlWithEmptyTree();
            var t = mapCtrl.MapView.Tree;
            var r = t.RootNode;
            var c1 = new MapNode(r, "c1");
            var c11 = new MapNode(c1, "c11");
            var c12 = new MapNode(c1, "c12");
            var c13 = new MapNode(c1, "c13");
            var c131 = new MapNode(c13, "c131");
            var c2 = new MapNode(r, "c2");
            var c3 = new MapNode(r, "c3", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c311 = new MapNode(c31, "c311");
            var c3111 = new MapNode(c311, "c3111");
            var c32 = new MapNode(c3, "c32");
            c32.AddToSelection();
            c311.AddToSelection();
            var undoCount = t.ChangeManager.UndoStackCount;

            mapCtrl.ChangeNodeShapeBullet();

            Assert.AreEqual(undoCount + 1, t.ChangeManager.UndoStackCount);
        }
开发者ID:,项目名称:,代码行数:24,代码来源:

示例10: ChangeLineWidth

        public void ChangeLineWidth()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();

            mapCtrl.ChangeLineWidth(4);

            Assert.AreEqual(4, r.LineWidth);
        }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例11: ChangeLineColorUsingPicker

        public void ChangeLineColorUsingPicker()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            A.CallTo(() => mainCtrl.ShowColorPicker(Color.Empty)).WithAnyArguments().Returns(Color.Chocolate);
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();

            mapCtrl.ChangeLineColorUsingPicker();

            Assert.AreEqual(Color.Chocolate, r.LineColor);
        }
开发者ID:,项目名称:,代码行数:17,代码来源:

示例12: ToggleItalic

        public void ToggleItalic()
        {
            MapTree tree = new MapTree();
            MapNode r = new MapNode(tree, "r");
            var c1 = new MapNode(r, "c1");
            var c2 = new MapNode(r, "c2");
            var form = new System.Windows.Forms.Form();
            MetaModel.MetaModel.Initialize();
            var mainCtrl = A.Fake<IMainCtrl>();
            MapCtrl mapCtrl = new MapCtrl(new MapView(tree), mainCtrl);
            form.Controls.Add(mapCtrl.MapView.Canvas);
            tree.TurnOnChangeManager();
            r.AddToSelection();
            c2.AddToSelection();
            c2.Italic = true;
            mapCtrl.ToggleItalic();

            Assert.IsFalse(c2.Italic);
            Assert.IsTrue(r.Italic);
        }
开发者ID:,项目名称:,代码行数:20,代码来源:

示例13: ChangeLineColor

        public void ChangeLineColor()
        {
            MapCtrl mapCtrl = SetupMapCtrlWithEmptyTree();
            var t = mapCtrl.MapView.Tree;
            var r = t.RootNode;
            var c1 = new MapNode(r, "c1");
            var c11 = new MapNode(c1, "c11");
            var c12 = new MapNode(c1, "c12");
            var c13 = new MapNode(c1, "c13");
            var c131 = new MapNode(c13, "c131");
            var c2 = new MapNode(r, "c2");
            var c3 = new MapNode(r, "c3", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c311 = new MapNode(c31, "c311");
            var c3111 = new MapNode(c311, "c3111");
            var c32 = new MapNode(c3, "c32");
            c1.AddToSelection();
            c2.AddToSelection();

            mapCtrl.ChangeLineColor(Color.Brown);

            Assert.AreEqual(Color.Brown, c1.LineColor);
            Assert.AreEqual(Color.Brown, c2.LineColor);
            Assert.AreEqual(Color.Empty, c3.LineColor);
        }
开发者ID:,项目名称:,代码行数:25,代码来源:


注:本文中的MindMate.Model.MapNode.AddToSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。