public void SetDesignerActionPanel(DesignerActionPanel panel, Glyph relatedGlyph)
 {
     if ((this._panel == null) || (panel != ((DesignerActionPanel) this._panel.Control)))
     {
         this.relatedGlyph = relatedGlyph;
         panel.SizeChanged += new EventHandler(this.PanelResized);
         if (this._panel != null)
         {
             this.Items.Remove(this._panel);
             this._panel.Dispose();
             this._panel = null;
         }
         this._panel = new ToolStripControlHost(panel);
         this._panel.Margin = Padding.Empty;
         this._panel.Size = panel.Size;
         base.SuspendLayout();
         base.Size = panel.Size;
         this.Items.Add(this._panel);
         base.ResumeLayout();
         if (base.Visible)
         {
             this.CheckFocusIsRight();
         }
     }
 }
 internal DesignerActionPanel CreateDesignerActionPanel(IComponent relatedComponent)
 {
     DesignerActionListCollection actionLists = new DesignerActionListCollection();
     actionLists.AddRange(this.ActionLists);
     DesignerActionPanel panel = new DesignerActionPanel(this.serviceProvider);
     panel.UpdateTasks(actionLists, new DesignerActionListCollection(), System.Design.SR.GetString("DesignerActionPanel_DefaultPanelTitle", new object[] { relatedComponent.GetType().Name }), null);
     return panel;
 }
 public DesignerActionKeyboardBehavior(DesignerActionPanel panel, IServiceProvider serviceProvider, BehaviorService behaviorService) : base(true, behaviorService)
 {
     this.panel = panel;
     if (serviceProvider != null)
     {
         this.menuService = serviceProvider.GetService(typeof(IMenuCommandService)) as IMenuCommandService;
         this.daUISvc = serviceProvider.GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
     }
 }
 public SeparatorLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
     : this(serviceProvider, actionPanel, false)
 {
 }
 public MethodLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
     : base(serviceProvider, actionPanel)
 {
 }
 public Line(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
 {
     if (actionPanel == null)
     {
         throw new ArgumentNullException("actionPanel");
     }
     this._serviceProvider = serviceProvider;
     this._actionPanel = actionPanel;
 }
 public static int GetTextMetrics(HandleRef hDC, ref DesignerActionPanel.EditorPropertyLine.NativeMethods.TEXTMETRIC lptm)
 {
     if (Marshal.SystemDefaultCharSize == 1)
     {
         DesignerActionPanel.EditorPropertyLine.NativeMethods.TEXTMETRICA textmetrica = new DesignerActionPanel.EditorPropertyLine.NativeMethods.TEXTMETRICA();
         int textMetricsA = GetTextMetricsA(hDC, ref textmetrica);
         lptm.tmHeight = textmetrica.tmHeight;
         lptm.tmAscent = textmetrica.tmAscent;
         lptm.tmDescent = textmetrica.tmDescent;
         lptm.tmInternalLeading = textmetrica.tmInternalLeading;
         lptm.tmExternalLeading = textmetrica.tmExternalLeading;
         lptm.tmAveCharWidth = textmetrica.tmAveCharWidth;
         lptm.tmMaxCharWidth = textmetrica.tmMaxCharWidth;
         lptm.tmWeight = textmetrica.tmWeight;
         lptm.tmOverhang = textmetrica.tmOverhang;
         lptm.tmDigitizedAspectX = textmetrica.tmDigitizedAspectX;
         lptm.tmDigitizedAspectY = textmetrica.tmDigitizedAspectY;
         lptm.tmFirstChar = (char) textmetrica.tmFirstChar;
         lptm.tmLastChar = (char) textmetrica.tmLastChar;
         lptm.tmDefaultChar = (char) textmetrica.tmDefaultChar;
         lptm.tmBreakChar = (char) textmetrica.tmBreakChar;
         lptm.tmItalic = textmetrica.tmItalic;
         lptm.tmUnderlined = textmetrica.tmUnderlined;
         lptm.tmStruckOut = textmetrica.tmStruckOut;
         lptm.tmPitchAndFamily = textmetrica.tmPitchAndFamily;
         lptm.tmCharSet = textmetrica.tmCharSet;
         return textMetricsA;
     }
     return GetTextMetricsW(hDC, ref lptm);
 }
Exemplo n.º 8
0
 public Line(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
 {
     _serviceProvider = serviceProvider;
     _actionPanel     = actionPanel.OrThrowIfNull();
 }
 public EditorLabelAccessibleObject(DesignerActionPanel.TextBoxPropertyLine.EditorLabel owner)
     : base(owner)
 {
 }
Exemplo n.º 10
0
 public Line(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
 {
     _serviceProvider = serviceProvider;
     _actionPanel     = actionPanel ?? throw new ArgumentNullException(nameof(actionPanel));
 }
 internal void ShowDesignerActionPanel(IComponent relatedComponent, DesignerActionPanel panel, DesignerActionGlyph glyph)
 {
     if (this.designerActionHost == null)
     {
         this.designerActionHost = new DesignerActionToolStripDropDown(this, this.mainParentWindow);
         this.designerActionHost.AutoSize = false;
         this.designerActionHost.Padding = Padding.Empty;
         this.designerActionHost.Renderer = new NoBorderRenderer();
         this.designerActionHost.Text = "DesignerActionTopLevelForm";
         this.designerActionHost.Closing += new ToolStripDropDownClosingEventHandler(this.toolStripDropDown_Closing);
     }
     this.designerActionHost.AccessibleName = System.Design.SR.GetString("DesignerActionPanel_DefaultPanelTitle", new object[] { relatedComponent.GetType().Name });
     panel.AccessibleName = System.Design.SR.GetString("DesignerActionPanel_DefaultPanelTitle", new object[] { relatedComponent.GetType().Name });
     this.designerActionHost.SetDesignerActionPanel(panel, glyph);
     Point screenLocation = this.UpdateDAPLocation(relatedComponent, glyph);
     if ((this.behaviorService != null) && this.behaviorService.AdornerWindowControl.DisplayRectangle.IntersectsWith(glyph.Bounds))
     {
         if ((this.mainParentWindow != null) && (this.mainParentWindow.Handle != IntPtr.Zero))
         {
             System.Design.UnsafeNativeMethods.SetWindowLong(new HandleRef(this.designerActionHost, this.designerActionHost.Handle), -8, new HandleRef(this.mainParentWindow, this.mainParentWindow.Handle));
         }
         this.cancelClose = true;
         this.designerActionHost.Show(screenLocation);
         this.designerActionHost.Focus();
         this.designerActionHost.BeginInvoke(new EventHandler(this.OnShowComplete));
         glyph.InvalidateOwnerLocation();
         this.lastPanelComponent = relatedComponent;
         this.dapkb = new DesignerActionKeyboardBehavior(this.designerActionHost.CurrentPanel, this.serviceProvider, this.behaviorService);
         this.behaviorService.PushBehavior(this.dapkb);
     }
 }
Exemplo n.º 12
0
 public CheckBoxPropertyLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
     : base(serviceProvider, actionPanel)
 {
 }
 public MethodLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel) : base(serviceProvider, actionPanel)
 {
 }
 public SeparatorLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel, bool isSubSeparator)
     : base(serviceProvider, actionPanel)
 {
     this._isSubSeparator = isSubSeparator;
 }
 public SeparatorLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel) : this(serviceProvider, actionPanel, false)
 {
 }
 public TextBoxPropertyLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
     : base(serviceProvider, actionPanel)
 {
 }
 public SeparatorLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel, bool isSubSeparator) : base(serviceProvider, actionPanel)
 {
     _isSubSeparator = isSubSeparator;
 }
 public TextLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
     : base(serviceProvider, actionPanel)
 {
     actionPanel.FontChanged += new EventHandler(this.OnParentControlFontChanged);
 }
 public DropDownHolder(Control hostedControl, Control parentControl, Color borderColor, Font font, DesignerActionPanel.EditorPropertyLine parent)
     : base(hostedControl, parentControl, borderColor, font)
 {
     this._parent = parent;
     this._parent.ActionPanel.SetDropDownActive(true);
 }
Exemplo n.º 20
0
 public PanelHeaderLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
     : base(serviceProvider, actionPanel)
 {
     actionPanel.FontChanged += new EventHandler(OnParentControlFontChanged);
 }
 public EditorPropertyLine(IServiceProvider serviceProvider, DesignerActionPanel actionPanel)
     : base(serviceProvider, actionPanel)
 {
 }