internal ToolStripAdornerWindowService(IServiceProvider serviceProvider, Control windowFrame) { this.serviceProvider = serviceProvider; this.toolStripAdornerWindow = new ToolStripAdornerWindow(windowFrame); this.bs = (BehaviorService) serviceProvider.GetService(typeof(BehaviorService)); int adornerWindowIndex = this.bs.AdornerWindowIndex; this.os = (IOverlayService) serviceProvider.GetService(typeof(IOverlayService)); if (this.os != null) { this.os.InsertOverlay(this.toolStripAdornerWindow, adornerWindowIndex); } this.dropDownAdorner = new Adorner(); int count = this.bs.Adorners.Count; if (count > 1) { this.bs.Adorners.Insert(count - 1, this.dropDownAdorner); } }
internal ToolStripAdornerWindowService(IServiceProvider serviceProvider, Control windowFrame) { this.serviceProvider = serviceProvider; this.toolStripAdornerWindow = new ToolStripAdornerWindow(windowFrame); this.bs = (BehaviorService)serviceProvider.GetService(typeof(BehaviorService)); int adornerWindowIndex = this.bs.AdornerWindowIndex; this.os = (IOverlayService)serviceProvider.GetService(typeof(IOverlayService)); if (this.os != null) { this.os.InsertOverlay(this.toolStripAdornerWindow, adornerWindowIndex); } this.dropDownAdorner = new Adorner(); int count = this.bs.Adorners.Count; if (count > 1) { this.bs.Adorners.Insert(count - 1, this.dropDownAdorner); } }
/// <summary> /// This constructor is called from DocumentDesigner's Initialize method. /// </summary> internal ToolStripAdornerWindowService(IServiceProvider serviceProvider, Control windowFrame) { _serviceProvider = serviceProvider; //create the AdornerWindow _toolStripAdornerWindow = new ToolStripAdornerWindow(windowFrame); _behaviorService = (BehaviorService)serviceProvider.GetService(typeof(BehaviorService)); int indexToInsert = _behaviorService.AdornerWindowIndex; //use the adornerWindow as an overlay _overlayService = (IOverlayService)serviceProvider.GetService(typeof(IOverlayService)); if (_overlayService != null) { _overlayService.InsertOverlay(_toolStripAdornerWindow, indexToInsert); } _dropDownAdorner = new Adorner(); int count = _behaviorService.Adorners.Count; // Why this is NEEDED ? To Add the Adorner at proper index in the AdornerCollection for the BehaviorService. So that the DesignerActionGlyph always stays on the Top. if (count > 1) { _behaviorService.Adorners.Insert(count - 1, _dropDownAdorner); } }