public void SetGeoObjectList(GeoObjectList SelectedObjects) { for (int i = 0; i < selectedObjects.Count; ++i) { selectedObjects[i].DidChangeEvent -= new CADability.GeoObject.ChangeDelegate(GeoObjectDidChange); } selectedObjects = SelectedObjects; for (int i = 0; i < selectedObjects.Count; ++i) { selectedObjects[i].DidChangeEvent += new CADability.GeoObject.ChangeDelegate(GeoObjectDidChange); } if (showProperties != null) { for (int i = 0; i < showProperties.Length; ++i) { IDisplayHotSpots hsp = showProperties[i] as IDisplayHotSpots; if (hsp != null) { hsp.HotspotChangedEvent -= new HotspotChangedDelegate(OnSubHotspotChanged); } IGeoObjectShowProperty gsp = showProperties[i] as IGeoObjectShowProperty; if (gsp != null) { gsp.CreateContextMenueEvent -= new CreateContextMenueDelegate(OnCreateSubContextMenue); } } } showProperties = null; focusedSelectedObject = null; if (propertyPage != null) { propertyPage.Refresh(this); // TODO: muss woanders hin, geht hier nicht! if (multiObjectsProperties != null) { propertyPage.OpenSubEntries(multiObjectsProperties.attributeProperties, true); } } }
/// <summary> /// Will be called when a context menu of a sub entry has been generated. This implementation adds the standard menu entries for selected objects. /// </summary> /// <param name="sender">The ControlCenter entry that has its context menu created</param> /// <param name="toManipulate">The context menu, which may be manipulated</param> protected void OnCreateSubContextMenue(IGeoObjectShowProperty sender, List <MenuWithHandler> toManipulate) { ContextMenuSource = sender.GetGeoObject(); toManipulate.Add(MenuWithHandler.Separator); toManipulate.AddRange(MenuResource.LoadMenuDefinition("MenuId.SelectedObject", false, Frame.CommandHandler)); }
void OnCreateContextMenueChild(IGeoObjectShowProperty sender, List <MenuWithHandler> toManipulate) { ContextMenuSource = sender.GetGeoObject(); MenuWithHandler[] toAdd = MenuResource.LoadMenuDefinition("MenuId.SelectedObject", false, Frame.CommandHandler); toManipulate.AddRange(toAdd); }