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


C# Model.MapNode类代码示例

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


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

示例1: SortChildren_WithRootNodeSortABC_Desc

        public void SortChildren_WithRootNodeSortABC_Desc()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "C");
            var c11 = new MapNode(c1, "c11");
            var c12 = new MapNode(c1, "c12");
            var c121 = new MapNode(c12, "c121");
            var c13 = new MapNode(c1, "c13");
            var c131 = new MapNode(c13, "c131");
            var c1311 = new MapNode(c131, "c1311");
            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");
            var c4 = new MapNode(r, "A");
            var c5 = new MapNode(r, "F");
            var c6 = new MapNode(r, "D");
            var c7 = new MapNode(r, "E");

            r.SortChildren((node1, node2) => string.CompareOrdinal(node2.Text, node1.Text));

            Assert.AreEqual(c5, r.FirstChild);
            Assert.AreEqual(c7, r.FirstChild.Next);
            Assert.AreEqual(c2, r.LastChild.Previous);
            Assert.AreEqual(c4, r.LastChild);
        }
开发者ID:,项目名称:,代码行数:26,代码来源:

示例2: SetNoteEditorBackColor

        public void SetNoteEditorBackColor()
        {
            bool result = true;

            System.Threading.Thread t = new System.Threading.Thread(() =>
            {
                MetaModel.MetaModel.Initialize();
                var persistence = new PersistenceManager();
                var noteEditor = new NoteEditor();

                var form = CreateForm();
                form.Controls.Add(noteEditor);
                form.Shown += (sender, args) =>
                {
                    var ptree1 = persistence.NewTree();
                    var c1 = new MapNode(ptree1.Tree.RootNode, "c1");
                    c1.Selected = true;

                    var sut = new NoteEditorCtrl(noteEditor, persistence);
                    sut.SetNoteEditorBackColor(Color.Azure);

                    result = noteEditor.BackColor.Equals(Color.Azure);

                    form.Close();
                };

                form.ShowDialog();
            });
            t.SetApartmentState(System.Threading.ApartmentState.STA);
            t.Start();
            t.Join();

            Assert.IsTrue(result);
        }
开发者ID:,项目名称:,代码行数:34,代码来源:

示例3: NodeDetach

 public NodeDetach(MapNode node)
 {
     this.node = node;
     this.parent = node.Parent;
     this.siblingAbove = node.Previous;
     this.position = node.Pos;
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例4: MoveNodeUp

        public void MoveNodeUp()
        {
            var t = new MapTree();
            var r = new MapNode(t, "r");

            r.MoveUp();
        }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例5: Tree_AttributeChanged

        private void Tree_AttributeChanged(MapNode node, AttributeChangeEventArgs e)
        {
            //// Task List Change
            // task completed
            if (e.ChangeType == AttributeChange.Added && e.AttributeSpec.IsCompletionDate())
            {
                Add(node);
                TaskChanged(node, GetEventArgs(node, CompletedTaskChange.TaskCompleted, e));                
            }
            // task removed
            else if (e.ChangeType == AttributeChange.Removed && e.AttributeSpec.IsCompletionDate())
            {
                if (Remove(node))
                {
                    TaskChanged(node, GetEventArgs(node, CompletedTaskChange.TaskRemoved, e));                 
                }
            }
            // completion date updated
            else if(e.ChangeType == AttributeChange.ValueUpdated && e.AttributeSpec.IsCompletionDate())
            {
                Remove(node);
                Add(node);
                TaskChanged(node, GetEventArgs(node, CompletedTaskChange.CompletionDateUpdated, e));
            }

            //// Task Property Change (which doesn't affect list)
            else if(CompletedTaskPropertyChanged != null && e.AttributeSpec.IsStartDate() && node.IsTaskComplete())
            {
                var args = new CompletedTaskPropertyEventArgs(){ PropertyChanged = CompletedTaskProperty.StartDate };
                if (!string.IsNullOrEmpty(e.oldValue)) args.OldValue = DateHelper.ToDateTime(e.oldValue);
                CompletedTaskPropertyChanged(node, args);
            }
        }        
开发者ID:,项目名称:,代码行数:33,代码来源:

示例6: TaskView

        public TaskView(MapNode node, string dueOnText,
            Action<TaskView, TaskViewEvent> onTaskViewEvent, bool showDeferOption = true)
        {
            InitializeComponent();

            ShowDeferOption = showDeferOption;

            this.ContextMenuStrip = CreateContextMenu();

            OnTaskViewEvent = onTaskViewEvent;

            SetQuickActionsVisiblity(false);

            MapNode = node;

            TaskTitle = node.Text;

            RefreshTaskPath();

            TaskDueOnText = dueOnText;

            if (node.Selected)
                Selected = true;

            this.Paint += new System.Windows.Forms.PaintEventHandler(this.TaskView_Paint);
        }
开发者ID:,项目名称:,代码行数:26,代码来源:

示例7: AddHyperlink

        public void AddHyperlink()
        {
            MapCtrl mapCtrl = SetupMapCtrlWithEmptyTree();
            var t = mapCtrl.MapView.Tree;
            var r = t.RootNode;
            var c1 = new MapNode(r, "c1");
            var c11 = new MapNode(c1, "6");
            var c12 = new MapNode(c1, "2");
            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 c121 = new MapNode(c12, "c121");
            var c2 = new MapNode(r, "c2");
            var c3 = new MapNode(r, "c3", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c32 = new MapNode(c3, "c32");
            r.Selected = true;
            t.SelectedNodes.Add(c32, true);

            mapCtrl.AddHyperlink("abc");

            Assert.AreEqual("abc", r.Link);
            Assert.AreEqual("abc", c32.Link);
            Assert.IsNull(c31.Link);
        }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例8: Serialize

        public void Serialize(MapNode node, Emitter emitter)
        {
            emitter.Emit(new MappingStart());

            SerializeScalarProperties(node, emitter);

            emitter.Emit(new MappingEnd());
        }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例9: SerializeImage_InvalidChar

 public void SerializeImage_InvalidChar()
 {
     MetaModel.MetaModel.Initialize();
     var refNode = new MapNode(new MapTree(), "OK");
     refNode.Italic = true;
     var nodeStyle = new NodeStyle("TestStyle\"1", refNode, true);
     new NodeStyleImageSerializer().SerializeImage(nodeStyle.Image, nodeStyle.Title);
 }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例10: NodeView

        public NodeView(MapNode node, PointF location)
        {
            this.node = node;
            this.left = location.X;
            this.top = location.Y;

            CreateNodeViewContent();
        }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例11: RemoveCompletionDate

 /// <summary>
 /// Delete this attribute from the given node if attribute exists
 /// </summary>
 /// <param name="node"></param>
 public static void RemoveCompletionDate(MapNode node)
 {
     MapTree.AttributeSpec aspec = GetAttributeSpec(node.Tree);
     if (aspec != null)
     {
         node.DeleteAttribute(aspec);
     }
 }
开发者ID:,项目名称:,代码行数:12,代码来源:

示例12: Copy

        public void Copy(MapNode node, bool multiApply = false)
        {
            this.formatSource = node;
            Status = multiApply? FormatPainterStatus.MultiApply : FormatPainterStatus.SingleApply;
            mapView.Canvas.KeyDown += Canvas_KeyDown;
            mapView.Canvas.NodeMouseEnter += Canvas_NodeMouseEnter;
            mapView.Canvas.NodeMouseExit += Canvas_NodeMouseExit;

            if(StateChanged != null) { StateChanged(this); }
        }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例13: PendingTasks_TaskSelectionChanged

        private void PendingTasks_TaskSelectionChanged(MapNode node, TaskSelectionEventArgs e)
        {
            TaskReminderDialog dialog = GetOpenDialog(node);
            if (dialog == null) return;

            if (e.ChangeType == TaskSelectionChange.Selected)
                dialog.TaskView.Selected = true;
            else
                dialog.TaskView.Selected = false;
        }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例14: PendingTasks_TaskTextChanged

        private void PendingTasks_TaskTextChanged(MapNode node, TaskTextEventArgs e)
        {
            TaskReminderDialog dialog = GetOpenDialog(node);
            if (dialog == null) return;

            if (e.ChangeType == TaskTextChange.TextChange)
                dialog.TaskView.TaskTitle = node.Text;
            else if (e.ChangeType == TaskTextChange.AncestorTextChange)
                dialog.TaskView.RefreshTaskPath();
        }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例15: Add_ReAddingNode_OneSelectedEvent

        public void Add_ReAddingNode_OneSelectedEvent()
        {
            var t = new MapTree();
            var r = new MapNode(t, "r");
            int eventSelectCount = 0;
            t.SelectedNodes.NodeSelected += (node, nodes) => eventSelectCount++;
            t.SelectedNodes.Add(r);
            t.SelectedNodes.Add(r);

            Assert.AreEqual(1, eventSelectCount);
        }
开发者ID:,项目名称:,代码行数:11,代码来源:


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