void Map_LayoutTypeChanged(object sender, EventArgs e) { ChartLayouter = LayoutManage.GetLayouter(Map.LayoutType); if (!IsUpdating) { UpdateView(ChangeTypes.AllVisual); } }
//protected override Padding DefaultMargin //{ // get // { // return new Padding(8); // } //} //protected override Padding DefaultPadding //{ // get // { // return new Padding(2); // } //} private void OnMapChanged(MindMap old) { if (old != null) { old.PropertyChanged -= new Blumind.Core.PropertyChangedEventHandler(Map_StyleChanged); old.LayoutTypeChanged -= new EventHandler(Map_LayoutTypeChanged); old.ChartObjectPropertyChanged -= new Blumind.Core.PropertyChangedEventHandler(Map_ChartObjectPropertyChanged); old.TopicAdded -= new TopicEventHandler(Map_TopicAdded); old.TopicRemoved -= new TopicEventHandler(Map_TopicRemoved); old.TopicAfterSort -= new EventHandler(Map_TopicAfterSort); old.ObjectStyleChanged -= new ChartObjectPropertyEventHandler(Chart_ChartObjectStyleChanged); //old.TopicTextChanged -= new TopicEventHandler(Map_TopicTextChanged); old.TopicWidgetChanged -= new Blumind.Core.PropertyChangedEventHandler(Map_TopicWidgetChanged); old.TopicDescriptionChanged -= new TopicEventHandler(Map_TopicDescriptionChanged); old.TopicFoldedChanged -= new TopicEventHandler(Map_TopicFoldedChanged); old.TopicWidthChanged -= new TopicEventHandler(Map_TopicWidthChanged); old.TopicHeightChanged -= new TopicEventHandler(Map_TopicHeightChanged); old.TopicIconChanged -= new TopicEventHandler(Map_TopicIconChanged); old.TopicBeforeCollapse -= new TopicCancelEventHandler(Map_TopicBeforeCollapse); old.LinkAdded -= new LinkEventHandler(Map_LinkAdded); old.LinkRemoved -= new LinkEventHandler(Map_LinkRemoved); old.WidgetRemoved -= new WidgetEventHandler(Map_WidgetRemoved); old.LinkPropertyChanged -= new Blumind.Core.PropertyChangedEventHandler(Map_LinkChanged); old.LinkVisibleChanged -= new LinkEventHandler(Map_LinkVisibleChanged); } if (Map != null) { ChartLayouter = LayoutManage.GetLayouter(Map.LayoutType); Map.PropertyChanged += new Blumind.Core.PropertyChangedEventHandler(Map_StyleChanged); Map.LayoutTypeChanged += new EventHandler(Map_LayoutTypeChanged); Map.ModifiedChanged += new EventHandler(Map_ModifiedChanged); Map.ChartObjectPropertyChanged += new Blumind.Core.PropertyChangedEventHandler(Map_ChartObjectPropertyChanged); Map.TopicAdded += new TopicEventHandler(Map_TopicAdded); Map.TopicRemoved += new TopicEventHandler(Map_TopicRemoved); Map.TopicAfterSort += new EventHandler(Map_TopicAfterSort); Map.ObjectStyleChanged += new ChartObjectPropertyEventHandler(Chart_ChartObjectStyleChanged); //Map.TopicTextChanged += new TopicEventHandler(Map_TopicTextChanged); Map.TopicWidgetChanged += new Blumind.Core.PropertyChangedEventHandler(Map_TopicWidgetChanged); Map.TopicDescriptionChanged += new TopicEventHandler(Map_TopicDescriptionChanged); Map.TopicFoldedChanged += new TopicEventHandler(Map_TopicFoldedChanged); Map.TopicWidthChanged += new TopicEventHandler(Map_TopicWidthChanged); Map.TopicHeightChanged += new TopicEventHandler(Map_TopicHeightChanged); Map.TopicIconChanged += new TopicEventHandler(Map_TopicIconChanged); Map.TopicBeforeCollapse += new TopicCancelEventHandler(Map_TopicBeforeCollapse); Map.LinkAdded += new LinkEventHandler(Map_LinkAdded); Map.LinkRemoved += new LinkEventHandler(Map_LinkRemoved); Map.WidgetRemoved += new WidgetEventHandler(Map_WidgetRemoved); Map.LinkPropertyChanged += new Blumind.Core.PropertyChangedEventHandler(Map_LinkChanged); Map.LinkVisibleChanged += new LinkEventHandler(Map_LinkVisibleChanged); } else { ChartLayouter = null; } if (Map != null && Map.Root != null) { Select(Map.Root); //SelectTopic(Map.Root); } Modified = false; ClearCommandHistory(); ResetChartStyle(); UpdateView(ChangeTypes.All); ScrollToCenter(); }