internal IChange CreateChange(MapTree tree, TreeDefaultFormatChangedEventArgs e) { switch (e.ChangeType) { case TreeFormatChange.NodeFormat: return(new DefaultTreeFormatChange(tree, (NodeFormat)e.OldValue)); case TreeFormatChange.MapCanvasBackColor: return(new MapCanvasBackColorChange(tree, (Color)e.OldValue)); case TreeFormatChange.NoteEditorBackColor: return(new NoteEditorBackColorChange(tree, (Color)e.OldValue)); case TreeFormatChange.NoteEditorForeColor: return(new NoteEditorTextColorChange(tree, (Color)e.OldValue)); case TreeFormatChange.NodeHighlightColor: return(new NodeHighlightColorChange(tree, (Color)e.OldValue)); case TreeFormatChange.NodeDropHintColor: return(new NodeDropHintColorChange(tree, (Color)e.OldValue)); default: return(null); } }
private void Tree_TreeFormatChanged(MapTree tree, TreeDefaultFormatChangedEventArgs e) { IChange change = factory.CreateChange(tree, e); if (change != null) { RecordChange(change); } }
private void Tree_TreeFormatChanged(MapTree tree, TreeDefaultFormatChangedEventArgs e) { switch (e.ChangeType) { case TreeFormatChange.NoteEditorBackColor: editor.BackColor = tree.NoteBackColor; break; case TreeFormatChange.NoteEditorForeColor: editor.ForeColor = tree.NoteForeColor; break; } }
private void Tree_TreeFormatChanged(MapTree tree, TreeDefaultFormatChangedEventArgs e) { switch (e.ChangeType) { case TreeFormatChange.NodeFormat: Tree.RootNode.ForEach(n => n.NodeView?.RefreshFontAndFormat()); RefreshNodePositions(); break; case TreeFormatChange.NodeDropHintColor: case TreeFormatChange.NodeHighlightColor: break; case TreeFormatChange.MapCanvasBackColor: Canvas.BackColor = Tree.CanvasBackColor; return; //no need to invalidate canvas case TreeFormatChange.NoteEditorBackColor: //this event is handled by NoteMapGlue return; //no need to invalidate canvas } Canvas.Invalidate(); }
private void PersistentTree_TreeFormatChanged(MapTree arg1, TreeDefaultFormatChangedEventArgs arg2) { TreeChanged(); }