public Hierarchy(TreeView treeView, PolygonManager polygonManager, RelationCreator relationCreator) { this.treeView = treeView; this.polygonManager = polygonManager; this.relationCreator = relationCreator; treeView.AfterSelect += ItemSelected; treeView.MouseClick += HierarchyClick; treeView.MouseDown += HierarchyMouseDown; }
public Form1() { InitializeComponent(); polygonManager = new PolygonManager(canvas, ChangeCursor, ChangeStatusStrip); var relationCreator = new RelationCreator(errorLabel, (selectedEdge1, selectedEdge2)); relationCreator.InitEvents(remove1, remove2, addEqualButton, addPerpendicularButton); hierarchyController = new Hierarchy(hierarchy, polygonManager, relationCreator); hierarchyController.Update(); polygonManager.OnStructureChanged += hierarchyController.HandleHierarchyChange; polygonManager.Update(); addEqualButton.Click += UpdateAll; addPerpendicularButton.Click += UpdateAll; polygonManager.GetPolygons().Add(Polygon.GetBigSample()); UpdateAll(this, null); }