public void AddRange (Adorner [] value)
		{
			state++;
			if (value == null)
				throw new ArgumentNullException ("value");
			InnerList.AddRange (value);
		}
 public void AddRange(Adorner[] value)
 {
     for (int i = 0; i < value.Length; i++)
     {
         this.Add(value[i]);
     }
 }
 private DesignerActionGlyph(DesignerActionBehavior behavior, Adorner adorner, Rectangle alternativeBounds, Control alternativeParent) : base(behavior)
 {
     this.alternativeBounds = Rectangle.Empty;
     this.adorner = adorner;
     this.alternativeBounds = alternativeBounds;
     this.alternativeParent = alternativeParent;
     this.Invalidate();
 }
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            panelAdorner = new Adorner();

            BehaviorService bs = RibbonDesigner.Current.GetBehaviorService();

            if (bs == null) return;

            bs.Adorners.AddRange(new [] { panelAdorner });

            panelAdorner.Glyphs.Add(new RibbonPanelGlyph(bs, this, Tab));
        }
 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);
     }
 }
 public void Dispose()
 {
     if (this.os != null)
     {
         this.os.RemoveOverlay(this.toolStripAdornerWindow);
     }
     this.toolStripAdornerWindow.Dispose();
     if (this.bs != null)
     {
         this.bs.Adorners.Remove(this.dropDownAdorner);
         this.bs = null;
     }
     if (this.dropDownAdorner != null)
     {
         this.dropDownAdorner.Glyphs.Clear();
         this.dropDownAdorner = null;
     }
 }
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

             panelAdorner = new Adorner();

             //Kevin Carbis - another point where exception is thrown by the designer when current is null
             if (RibbonDesigner.Current != null)
             {
            BehaviorService bs = RibbonDesigner.Current.GetBehaviorService();

            if (bs == null) return;

            bs.Adorners.AddRange(new Adorner[] { panelAdorner });

            panelAdorner.Glyphs.Add(new RibbonPanelGlyph(bs, this, Tab));
             }
        }
 public DesignerActionUI(IServiceProvider serviceProvider, Adorner containerAdorner)
 {
     this.serviceProvider = serviceProvider;
     this.designerActionAdorner = containerAdorner;
     this.behaviorService = (BehaviorService) serviceProvider.GetService(typeof(BehaviorService));
     this.menuCommandService = (IMenuCommandService) serviceProvider.GetService(typeof(IMenuCommandService));
     this.selSvc = (ISelectionService) serviceProvider.GetService(typeof(ISelectionService));
     if ((this.behaviorService != null) && (this.selSvc != null))
     {
         this.designerActionService = (DesignerActionService) serviceProvider.GetService(typeof(DesignerActionService));
         if (this.designerActionService == null)
         {
             this.designerActionService = new DesignerActionService(serviceProvider);
             this.disposeActionService = true;
         }
         this.designerActionUIService = (DesignerActionUIService) serviceProvider.GetService(typeof(DesignerActionUIService));
         if (this.designerActionUIService == null)
         {
             this.designerActionUIService = new DesignerActionUIService(serviceProvider);
             this.disposeActionUIService = true;
         }
         this.designerActionUIService.DesignerActionUIStateChange += new DesignerActionUIStateChangeEventHandler(this.OnDesignerActionUIStateChange);
         this.designerActionService.DesignerActionListsChanged += new DesignerActionListsChangedEventHandler(this.OnDesignerActionsChanged);
         this.lastPanelComponent = null;
         IComponentChangeService service = (IComponentChangeService) serviceProvider.GetService(typeof(IComponentChangeService));
         if (service != null)
         {
             service.ComponentChanged += new ComponentChangedEventHandler(this.OnComponentChanged);
         }
         if (this.menuCommandService != null)
         {
             this.cmdShowDesignerActions = new MenuCommand(new EventHandler(this.OnKeyShowDesignerActions), MenuCommands.KeyInvokeSmartTag);
             this.menuCommandService.AddCommand(this.cmdShowDesignerActions);
         }
         this.uiService = (IUIService) serviceProvider.GetService(typeof(IUIService));
         if (this.uiService != null)
         {
             this.mainParentWindow = this.uiService.GetDialogOwnerWindow();
         }
         this.componentToGlyph = new Hashtable();
         this.marshalingControl = new Control();
         this.marshalingControl.CreateControl();
     }
 }
        /// <summary>
        /// Initialize a new instance of the KryptonSplitContainerGlyph class.
        /// </summary>
        /// <param name="selectionService">Reference to the selection service.</param>
        /// <param name="behaviorService">Reference to the behavior service.</param>
        /// <param name="adorner">Reference to the containing adorner.</param>
        /// <param name="relatedDesigner">Reference to the containing designer.</param>
        public KryptonSplitContainerGlyph(ISelectionService selectionService,
                                          BehaviorService behaviorService,
                                          Adorner adorner,
                                          IDesigner relatedDesigner)
            : base(new KryptonSplitContainerBehavior(relatedDesigner))
        {
            Debug.Assert(selectionService != null);
            Debug.Assert(behaviorService != null);
            Debug.Assert(adorner != null);
            Debug.Assert(relatedDesigner != null);

            // Remember incoming references
            _selectionService = selectionService;
            _behaviorService = behaviorService;
            _adorner = adorner;

            // Find the related control
            _splitContainer = relatedDesigner.Component as KryptonSplitContainer;

            // We want to know whenever the selection has changed or a property has changed
            _selectionService.SelectionChanged += new EventHandler(OnSelectionChanged);
        }
 public SelectionManager(IServiceProvider serviceProvider, BehaviorService behaviorService)
 {
     this.behaviorService = behaviorService;
     this.serviceProvider = serviceProvider;
     this.selSvc = (ISelectionService) serviceProvider.GetService(typeof(ISelectionService));
     this.designerHost = (IDesignerHost) serviceProvider.GetService(typeof(IDesignerHost));
     if (this.designerHost != null)
     {
         ISelectionService selSvc = this.selSvc;
     }
     behaviorService.BeginDrag += new BehaviorDragDropEventHandler(this.OnBeginDrag);
     behaviorService.Synchronize += new EventHandler(this.OnSynchronize);
     this.selSvc.SelectionChanged += new EventHandler(this.OnSelectionChanged);
     this.rootComponent = (Control) this.designerHost.RootComponent;
     this.selectionAdorner = new Adorner();
     this.bodyAdorner = new Adorner();
     behaviorService.Adorners.Add(this.bodyAdorner);
     behaviorService.Adorners.Add(this.selectionAdorner);
     this.componentToDesigner = new Hashtable();
     IComponentChangeService service = (IComponentChangeService) serviceProvider.GetService(typeof(IComponentChangeService));
     if (service != null)
     {
         service.ComponentAdded += new ComponentEventHandler(this.OnComponentAdded);
         service.ComponentRemoved += new ComponentEventHandler(this.OnComponentRemoved);
         service.ComponentChanged += new ComponentChangedEventHandler(this.OnComponentChanged);
     }
     this.designerHost.TransactionClosed += new DesignerTransactionCloseEventHandler(this.OnTransactionClosed);
     DesignerOptionService service2 = this.designerHost.GetService(typeof(DesignerOptionService)) as DesignerOptionService;
     if (service2 != null)
     {
         PropertyDescriptor descriptor = service2.Options.Properties["UseSmartTags"];
         if (((descriptor != null) && (descriptor.PropertyType == typeof(bool))) && ((bool) descriptor.GetValue(null)))
         {
             this.designerActionUI = new DesignerActionUI(serviceProvider, this.selectionAdorner);
             behaviorService.DesignerActionUI = this.designerActionUI;
         }
     }
 }
Example #11
0
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            IComponentChangeService changeService = GetService(typeof(IComponentChangeService)) as IComponentChangeService;
            IDesignerEventService desigerEvt = GetService(typeof(IDesignerEventService)) as IDesignerEventService;

            changeService.ComponentRemoved += new ComponentEventHandler(changeService_ComponentRemoved);

            quickAccessAdorner = new Adorner();
            orbAdorner = new Adorner();
            tabAdorner = new Adorner();

            BehaviorService.Adorners.AddRange(new Adorner[] { quickAccessAdorner, orbAdorner, tabAdorner });

            quickAccessAdorner.Glyphs.Add(new RibbonQuickAccessToolbarGlyph(BehaviorService, this, Ribbon));
            //orbAdorner.Glyphs.Add(new RibbonOrbAdornerGlyph(BehaviorService, this, Ribbon));
            tabAdorner.Glyphs.Add(new RibbonTabGlyph(BehaviorService, this, Ribbon));
        }
 public int IndexOf(Adorner value)
 {
     return base.List.IndexOf(value);
 }
 public void Insert(int index, Adorner value)
 {
     base.List.Insert(index, value);
 }
 public bool Contains(Adorner value)
 {
     return base.List.Contains(value);
 }
 public void CopyTo(Adorner[] array, int index)
 {
     base.List.CopyTo(array, index);
 }
 public void Dispose()
 {
     if (this.traySelectionAdorner != null)
     {
         this.traySelectionAdorner.Glyphs.Clear();
         this.traySelectionAdorner = null;
     }
 }
		public void Remove (Adorner value)
		{
			state++;
			InnerList.Remove (value);
		}
 public void Remove(Adorner value)
 {
     base.List.Remove(value);
 }
 public BehaviorServiceAdornerCollection(Adorner[] value)
 {
     this.AddRange(value);
 }
		public void Insert (int index, Adorner value)
		{
			state++;
			InnerList.Insert (index, value);
		}
		public bool Contains (Adorner value)
		{
			return InnerList.Contains (value);
		}
		public void CopyTo (Adorner [] array, int index)
		{
			InnerList.CopyTo (array, index);
		}
		public BehaviorServiceAdornerCollection (Adorner [] value)
		{
			if (value == null)
				throw new ArgumentNullException ("value");
			InnerList.AddRange (value);
		}
 public DesignerActionGlyph(DesignerActionBehavior behavior, Adorner adorner) : this(behavior, adorner, Rectangle.Empty, null)
 {
 }
 public void Dispose()
 {
     if (this.marshalingControl != null)
     {
         this.marshalingControl.Dispose();
         this.marshalingControl = null;
     }
     if (this.serviceProvider != null)
     {
         IComponentChangeService service = (IComponentChangeService) this.serviceProvider.GetService(typeof(IComponentChangeService));
         if (service != null)
         {
             service.ComponentChanged -= new ComponentChangedEventHandler(this.OnComponentChanged);
         }
         if (this.cmdShowDesignerActions != null)
         {
             IMenuCommandService service2 = (IMenuCommandService) this.serviceProvider.GetService(typeof(IMenuCommandService));
             if (service2 != null)
             {
                 service2.RemoveCommand(this.cmdShowDesignerActions);
             }
         }
     }
     this.serviceProvider = null;
     this.behaviorService = null;
     this.selSvc = null;
     if (this.designerActionService != null)
     {
         this.designerActionService.DesignerActionListsChanged -= new DesignerActionListsChangedEventHandler(this.OnDesignerActionsChanged);
         if (this.disposeActionService)
         {
             this.designerActionService.Dispose();
         }
     }
     this.designerActionService = null;
     if (this.designerActionUIService != null)
     {
         this.designerActionUIService.DesignerActionUIStateChange -= new DesignerActionUIStateChangeEventHandler(this.OnDesignerActionUIStateChange);
         if (this.disposeActionUIService)
         {
             this.designerActionUIService.Dispose();
         }
     }
     this.designerActionUIService = null;
     this.designerActionAdorner = null;
 }
 public int Add(Adorner value)
 {
     value.BehaviorService = this.behaviorService;
     return base.List.Add(value);
 }
		public int Add (Adorner value)
		{
			state++;
			return InnerList.Add (value);
		}
 public ComponentTrayGlyphManager(ISelectionService selSvc, BehaviorService behaviorSvc)
 {
     this.selSvc = selSvc;
     this.behaviorSvc = behaviorSvc;
     this.traySelectionAdorner = new Adorner();
 }
 public void Dispose()
 {
     if (this.designerHost != null)
     {
         this.designerHost.TransactionClosed -= new DesignerTransactionCloseEventHandler(this.OnTransactionClosed);
         this.designerHost = null;
     }
     if (this.serviceProvider != null)
     {
         IComponentChangeService service = (IComponentChangeService) this.serviceProvider.GetService(typeof(IComponentChangeService));
         if (service != null)
         {
             service.ComponentAdded -= new ComponentEventHandler(this.OnComponentAdded);
             service.ComponentChanged -= new ComponentChangedEventHandler(this.OnComponentChanged);
             service.ComponentRemoved -= new ComponentEventHandler(this.OnComponentRemoved);
         }
         if (this.selSvc != null)
         {
             this.selSvc.SelectionChanged -= new EventHandler(this.OnSelectionChanged);
             this.selSvc = null;
         }
         this.serviceProvider = null;
     }
     if (this.behaviorService != null)
     {
         this.behaviorService.Adorners.Remove(this.bodyAdorner);
         this.behaviorService.Adorners.Remove(this.selectionAdorner);
         this.behaviorService.BeginDrag -= new BehaviorDragDropEventHandler(this.OnBeginDrag);
         this.behaviorService.Synchronize -= new EventHandler(this.OnSynchronize);
         this.behaviorService = null;
     }
     if (this.selectionAdorner != null)
     {
         this.selectionAdorner.Glyphs.Clear();
         this.selectionAdorner = null;
     }
     if (this.bodyAdorner != null)
     {
         this.bodyAdorner.Glyphs.Clear();
         this.bodyAdorner = null;
     }
     if (this.designerActionUI != null)
     {
         this.designerActionUI.Dispose();
         this.designerActionUI = null;
     }
 }
		public int IndexOf (Adorner value)
		{
			return InnerList.IndexOf (value);
		}