//==================================================================================== // Taxon control list changed // //--------------------------------------------------------------------------------- private void TaxonControlList_OnRegisterTaxonControl(object sender, TaxonControlEventArgs e) { /*if (e.ITC is TaxonGraphPanel) * { * TaxonUtils.MainGraph = e.ITC as TaxonGraphPanel; * TaxonUtils.MainGraph.OnSelectedChanged += taxonGraph_OnSelectedChanged; * TaxonUtils.MainGraph.OnReselect += taxonGraph_OnReselect; * TaxonUtils.MainGraph.OnGraphBelowChanged += taxonGraph_OnBelowChanged; * TaxonUtils.MainGraph.OnGraphRefreshed += taxonGraph_OnGraphRefreshed; * TaxonUtils.MainGraph.OnPaintRectangleChanged += taxonGraph_OnPaintRectangleChanged; * TaxonUtils.MainGraph.Root = TaxonUtils.Root; * } * else if (e.ITC is TaxonGraph) * { * } * else */ if (e.ITC is TaxonEditInfo) { TaxonEditInfo control = e.ITC as TaxonEditInfo; control.OnEditedTaxonChanged += taxonEditorInfo_OnTaxonChanged; } else if (e.ITC is TaxonNavigator) { TaxonNavigator control = e.ITC as TaxonNavigator; control.OnMoveRectangle += taxonNavigator_OnMoveRectangle; } }
//--------------------------------------------------------------------------------- private void TaxonControlList_OnUnregisterTaxonControl(object sender, TaxonControlEventArgs e) { if (e.ITC is TaxonGraph) { TaxonUtils.MainGraph.Graph.OnSelectedChanged -= taxonGraph_OnSelectedChanged; TaxonUtils.MainGraph.Graph.OnReselect -= taxonGraph_OnReselect; TaxonUtils.MainGraph.Graph.OnGraphBelowChanged -= taxonGraph_OnBelowChanged; TaxonUtils.MainGraph.Graph.OnGraphRefreshed -= taxonGraph_OnGraphRefreshed; TaxonUtils.MainGraph.Graph.OnPaintRectangleChanged -= taxonGraph_OnPaintRectangleChanged; TaxonUtils.MainGraph = null; } else if (e.ITC is TaxonEditInfo) { TaxonEditInfo control = e.ITC as TaxonEditInfo; control.OnEditedTaxonChanged -= taxonEditorInfo_OnTaxonChanged; } else if (e.ITC is TaxonNavigator) { TaxonNavigator control = e.ITC as TaxonNavigator; control.OnMoveRectangle -= taxonNavigator_OnMoveRectangle; } }