private void InitializeGraph() { // create new nodestyle that delegates to other // styles for different zoom ranges var nodeStyle = new OrgChartNodeStyle(); // specify the three different zoom ranges overviewRange = new OrgChartNodeStyle.DoubleRange(0, 0.3); intermediateRange = new OrgChartNodeStyle.DoubleRange(0.3, 0.8); detailRange = new OrgChartNodeStyle.DoubleRange(0.8, Double.PositiveInfinity); // set different node styles for the zoom ranges nodeStyle.SetNodeStyle(overviewRange, new OverviewNodeStyle()); nodeStyle.SetNodeStyle(intermediateRange, new IntermediateNodeStyle()); DetailNodeStyle detailNodeStyle = new DetailNodeStyle(); // add buttons to detail node style ButtonDecoratorNodeStyle buttonDecorator = new ButtonDecoratorNodeStyle(); buttonDecorator.DecoratedStyle = detailNodeStyle; AddDecoratorButtons(buttonDecorator); nodeStyle.SetNodeStyle(detailRange, buttonDecorator); graphControl.Graph.NodeDefaults.Style = nodeStyle; graphControl.Graph.NodeDefaults.Size = new SizeD(250, 100); graphControl.Graph.EdgeDefaults.Style = new PolylineEdgeStyle { SmoothingLength = 10 }; }
public MyClickHandler(INode node, OrgChartNodeStyle orgChartNodeStyle) { this.node = node; this.orgChartNodeStyle = orgChartNodeStyle; }