void ISelectionUIService.SetSelectionStyle(object component, SelectionStyles style) { SelectionUIItem item = (SelectionUIItem) this.selectionItems[component]; if ((this.selSvc != null) && this.selSvc.GetComponentSelected(component)) { item = new SelectionUIItem(this, component); this.selectionItems[component] = item; } if (item != null) { item.Style = style; this.UpdateWindowRegion(); item.Invalidate(); } }
private void OnSelectionChanged(object sender, EventArgs e) { ICollection selectedComponents = this.selSvc.GetSelectedComponents(); Hashtable hashtable = new Hashtable(selectedComponents.Count); bool flag = false; foreach (object obj2 in selectedComponents) { object obj3 = this.selectionItems[obj2]; bool flag2 = true; if (obj3 != null) { ContainerSelectionUIItem item = obj3 as ContainerSelectionUIItem; if (item != null) { item.Dispose(); flag = true; } else { hashtable[obj2] = obj3; flag2 = false; } } if (flag2) { flag = true; hashtable[obj2] = new SelectionUIItem(this, obj2); } } if (!flag) { flag = this.selectionItems.Keys.Count != hashtable.Keys.Count; } this.selectionItems = hashtable; if (flag) { this.UpdateWindowRegion(); } base.Invalidate(); base.Update(); }
void ISelectionUIService.AssignSelectionUIHandler(object component, ISelectionUIHandler handler) { ISelectionUIHandler handler2 = (ISelectionUIHandler) this.selectionHandlers[component]; if (handler2 != null) { if (handler != handler2) { throw new InvalidOperationException(); } } else { this.selectionHandlers[component] = handler; if ((this.selSvc != null) && this.selSvc.GetComponentSelected(component)) { SelectionUIItem item = new SelectionUIItem(this, component); this.selectionItems[component] = item; this.UpdateWindowRegion(); item.Invalidate(); } } }