public void AddPatch(Model model, Projection projection, Border area, LayoutView layoutView) { ArrayList al = new ArrayList(patches); LayoutPatch newPatch = new LayoutPatch(model, projection, area); foreach (Layer l in project.LayerList) { // alle Layer sichtbar newPatch.visibleLayers[l] = null; } al.Add(newPatch); if (layoutView != null) { newPatch.Connect(this, project, layoutView); } patches = (LayoutPatch[])al.ToArray(typeof(LayoutPatch)); }
public void Connect(Layout layout, Project project, LayoutView layoutView) { // das kommt dran, sobald der layoutview in der Liste im Treeview steht this.layout = layout; this.project = project; this.layoutView = layoutView; if (name == null) { int j = 1; bool invalidName = true; while (invalidName) { invalidName = false; string newname = StringTable.GetFormattedString("Layout.Patch.Label", j); for (int i = 0; i < layout.Patches.Length; ++i) { if (layout.Patches[i].name == newname) { invalidName = true; ++j; } } name = newname; } } base.LabelText = name; if (Area == null) { section = new BoundingRect(0.0, 0.0, layout.PaperWidth, layout.PaperHeight); Area = Border.MakeRectangle(section); } else { section = Area.Extent; } base.resourceId = "Layout.Patch"; project.LayerList.DidModifyEvent += new DidModifyDelegate(OnLayerListModifed); model.GeoObjectAddedEvent += new Model.GeoObjectAdded(OnModelChanged); model.GeoObjectRemovedEvent += new Model.GeoObjectRemoved(OnModelChanged); model.GeoObjectDidChangeEvent += new CADability.GeoObject.ChangeDelegate(OnModelChanged); Projection.ProjectionChangedEvent += new Projection.ProjectionChangedDelegate(OnProjectionChanged); }