• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Behavior.Glyph类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.Design.Behavior.Glyph的典型用法代码示例。如果您正苦于以下问题:C# Glyph类的具体用法?C# Glyph怎么用?C# Glyph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Glyph类属于System.Windows.Forms.Design.Behavior命名空间,在下文中一共展示了Glyph类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddRange

 public void AddRange(Glyph[] value)
 {
     for (int i = 0; i < value.Length; i++)
     {
         this.Add(value[i]);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:GlyphCollection.cs


示例2: SetDesignerActionPanel

 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();
         }
     }
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:25,代码来源:DesignerActionToolStripDropDown.cs


示例3: CheckAssociatedControl

 private bool CheckAssociatedControl(Component c, Glyph childGlyph, GlyphCollection glyphs)
 {
     bool flag = false;
     ToolStripDropDownItem dropDownItem = c as ToolStripDropDownItem;
     if (dropDownItem != null)
     {
         flag = this.CheckDropDownBounds(dropDownItem, childGlyph, glyphs);
     }
     if (flag)
     {
         return flag;
     }
     Control associatedControl = this.GetAssociatedControl(c);
     if (((associatedControl == null) || (associatedControl == this.toolStripContainer)) || System.Design.UnsafeNativeMethods.IsChild(new HandleRef(this.toolStripContainer, this.toolStripContainer.Handle), new HandleRef(associatedControl, associatedControl.Handle)))
     {
         return flag;
     }
     Rectangle bounds = childGlyph.Bounds;
     Rectangle rect = base.BehaviorService.ControlRectInAdornerWindow(associatedControl);
     if ((c == this.designerHost.RootComponent) || !bounds.IntersectsWith(rect))
     {
         glyphs.Insert(0, childGlyph);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:ToolStripContainerDesigner.cs


示例4: OnMouseUp

 public override bool OnMouseUp(Glyph g, MouseButtons button)
 {
     if ((button != MouseButtons.Left) || (this.ParentUI == null))
     {
         return true;
     }
     bool flag = true;
     if (this.ParentUI.IsDesignerActionPanelVisible)
     {
         this.HideUI();
     }
     else if (!this.ignoreNextMouseUp)
     {
         if (this.serviceProvider != null)
         {
             ISelectionService service = (ISelectionService) this.serviceProvider.GetService(typeof(ISelectionService));
             if ((service != null) && (service.PrimarySelection != this.RelatedComponent))
             {
                 List<IComponent> components = new List<IComponent> {
                     this.RelatedComponent
                 };
                 service.SetSelectedComponents(components, SelectionTypes.Click);
             }
         }
         this.ShowUI(g);
     }
     else
     {
         flag = false;
     }
     this.ignoreNextMouseUp = false;
     return flag;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:33,代码来源:DesignerActionBehavior.cs


示例5: BehaviorService

 internal BehaviorService(IServiceProvider serviceProvider, Control windowFrame)
 {
     this.serviceProvider = serviceProvider;
     this.adornerWindow = new AdornerWindow(this, windowFrame);
     IOverlayService service = (IOverlayService) serviceProvider.GetService(typeof(IOverlayService));
     if (service != null)
     {
         this.adornerWindowIndex = service.PushOverlay(this.adornerWindow);
     }
     this.dragEnterReplies = new Hashtable();
     this.adorners = new BehaviorServiceAdornerCollection(this);
     this.behaviorStack = new ArrayList();
     this.hitTestedGlyph = null;
     this.validDragArgs = null;
     this.actionPointer = null;
     this.trackMouseEvent = null;
     this.trackingMouseEvent = false;
     IMenuCommandService menuService = serviceProvider.GetService(typeof(IMenuCommandService)) as IMenuCommandService;
     IDesignerHost host = serviceProvider.GetService(typeof(IDesignerHost)) as IDesignerHost;
     if ((menuService != null) && (host != null))
     {
         this.menuCommandHandler = new MenuCommandHandler(this, menuService);
         host.RemoveService(typeof(IMenuCommandService));
         host.AddService(typeof(IMenuCommandService), this.menuCommandHandler);
     }
     this.useSnapLines = false;
     this.queriedSnapLines = false;
     WM_GETALLSNAPLINES = System.Design.SafeNativeMethods.RegisterWindowMessage("WM_GETALLSNAPLINES");
     WM_GETRECENTSNAPLINES = System.Design.SafeNativeMethods.RegisterWindowMessage("WM_GETRECENTSNAPLINES");
     SystemEvents.DisplaySettingsChanged += new EventHandler(this.OnSystemSettingChanged);
     SystemEvents.InstalledFontsChanged += new EventHandler(this.OnSystemSettingChanged);
     SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(this.OnUserPreferenceChanged);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:33,代码来源:BehaviorService.cs


示例6: OnMouseEnter

        /// <summary>
        ///  Called when any mouse-enter message enters the adorner window of the BehaviorService.
        /// </summary>
        /// <param name="g">A Glyph.</param>
        /// <returns>true if the message was handled; otherwise, false.</returns>
        public override bool OnMouseEnter(Glyph g)
        {
            // Notify the split container so it can track mouse message
            if (_splitContainer != null)
                _splitContainer.DesignMouseEnter();

            return base.OnMouseEnter(g);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:13,代码来源:KryptonSplitContainerBehavior.cs


示例7: OnDragLeave

 public virtual void OnDragLeave(Glyph g, EventArgs e)
 {
     if (this.callParentBehavior && (this.GetNextBehavior != null))
     {
         this.GetNextBehavior.OnDragLeave(g, e);
     }
     else if (this.GlyphIsValid(g))
     {
         g.Behavior.OnDragLeave(g, e);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:Behavior.cs


示例8: CheckDropDownBounds

 private bool CheckDropDownBounds(ToolStripDropDownItem dropDownItem, Glyph childGlyph, GlyphCollection glyphs)
 {
     if (dropDownItem == null)
     {
         return false;
     }
     Rectangle bounds = childGlyph.Bounds;
     Rectangle rect = base.BehaviorService.ControlRectInAdornerWindow(dropDownItem.DropDown);
     if (!bounds.IntersectsWith(rect))
     {
         glyphs.Insert(0, childGlyph);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:ToolStripContainerDesigner.cs


示例9: OnLoseCapture

 public override void OnLoseCapture(Glyph g, EventArgs e)
 {
     this.captureLost = true;
     if (this.pushedBehavior)
     {
         this.pushedBehavior = false;
         if (this.BehaviorService != null)
         {
             if (this.dragging)
             {
                 this.dragging = false;
                 for (int i = 0; !this.captureLost && (i < this.resizeComponents.Length); i++)
                 {
                     Control resizeControl = this.resizeComponents[i].resizeControl as Control;
                     Rectangle rect = this.BehaviorService.ControlRectInAdornerWindow(resizeControl);
                     if (!rect.IsEmpty)
                     {
                         using (Graphics graphics = this.BehaviorService.AdornerWindowGraphics)
                         {
                             graphics.SetClip(rect);
                             using (Region region = new Region(rect))
                             {
                                 region.Exclude(Rectangle.Inflate(rect, -2, -2));
                                 this.BehaviorService.Invalidate(region);
                             }
                             graphics.ResetClip();
                         }
                     }
                 }
                 this.BehaviorService.EnableAllAdorners(true);
             }
             this.BehaviorService.PopBehavior(this);
             if (this.lastResizeRegion != null)
             {
                 this.BehaviorService.Invalidate(this.lastResizeRegion);
                 this.lastResizeRegion.Dispose();
                 this.lastResizeRegion = null;
             }
         }
     }
     if (this.resizeTransaction != null)
     {
         DesignerTransaction resizeTransaction = this.resizeTransaction;
         this.resizeTransaction = null;
         using (resizeTransaction)
         {
             resizeTransaction.Cancel();
         }
     }
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:50,代码来源:ResizeBehavior.cs


示例10: OnDragOver

 public virtual void OnDragOver(Glyph g, DragEventArgs e)
 {
     if (this.callParentBehavior && (this.GetNextBehavior != null))
     {
         this.GetNextBehavior.OnDragOver(g, e);
     }
     else if (this.GlyphIsValid(g))
     {
         g.Behavior.OnDragOver(g, e);
     }
     else if (e.Effect != DragDropEffects.None)
     {
         e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:Behavior.cs


示例11: OnMouseDown

        /// <summary>
        ///  Called when any mouse-down message enters the adorner window of the BehaviorService.
        /// </summary>
        /// <param name="g">A Glyph.</param>
        /// <param name="button">A MouseButtons value indicating which button was clicked.</param>
        /// <param name="pt">The location at which the click occurred.</param>
        /// <returns>true if the message was handled; otherwise, false.</returns>
        public override bool OnMouseDown(Glyph g, MouseButtons button, Point pt)
        {
            if (_splitContainer != null)
            {
                // Convert the adorner coordinate to the split container client coordinate
                Point splitPt = PointToSplitContainer(g, pt);

                // Notify the split container so it can track mouse message
                if (_splitContainer.DesignMouseDown(splitPt, button))
                {
                    // Splitter is starting to be moved, we need to capture mouse input
                    _splitContainer.Capture = true;
                }
            }

            return base.OnMouseDown(g, button, pt);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:24,代码来源:KryptonSplitContainerBehavior.cs


示例12: OnMouseDown

 public override bool OnMouseDown(Glyph g, MouseButtons button, Point mouseLoc)
 {
     if (button == MouseButtons.Left)
     {
         ISelectionService service = (ISelectionService) this.serviceProvider.GetService(typeof(ISelectionService));
         if ((service != null) && !this.containerControl.Equals(service.PrimarySelection as Control))
         {
             service.SetSelectedComponents(new object[] { this.containerControl }, SelectionTypes.Toggle | SelectionTypes.Click);
             ContainerSelectorGlyph glyph = g as ContainerSelectorGlyph;
             if (glyph == null)
             {
                 return false;
             }
             using (BehaviorServiceAdornerCollectionEnumerator enumerator = this.behaviorService.Adorners.GetEnumerator())
             {
                 while (enumerator.MoveNext())
                 {
                     foreach (Glyph glyph2 in enumerator.Current.Glyphs)
                     {
                         ContainerSelectorGlyph glyph3 = glyph2 as ContainerSelectorGlyph;
                         if ((glyph3 != null) && !glyph3.Equals(glyph))
                         {
                             ContainerSelectorBehavior relatedBehavior = glyph3.RelatedBehavior as ContainerSelectorBehavior;
                             ContainerSelectorBehavior behavior2 = glyph.RelatedBehavior as ContainerSelectorBehavior;
                             if (((relatedBehavior != null) && (behavior2 != null)) && behavior2.ContainerControl.Equals(relatedBehavior.ContainerControl))
                             {
                                 relatedBehavior.OkToMove = true;
                                 relatedBehavior.InitialDragPoint = this.DetermineInitialDragPoint(mouseLoc);
                                 continue;
                             }
                         }
                     }
                 }
                 goto Label_0167;
             }
         }
         this.InitialDragPoint = this.DetermineInitialDragPoint(mouseLoc);
         this.OkToMove = true;
     }
     Label_0167:
     return false;
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:42,代码来源:ContainerSelectorBehavior.cs


示例13: OnMouseMove

 public override bool OnMouseMove(Glyph g, MouseButtons button, Point mouseLoc)
 {
     if (!this.pushedBehavior)
     {
         return false;
     }
     bool flag = Control.ModifierKeys == Keys.Alt;
     if (flag && (this.dragManager != null))
     {
         this.dragManager.EraseSnapLines();
     }
     if (flag || !mouseLoc.Equals(this.lastMouseLoc))
     {
         if (this.lastMouseAbs != null)
         {
             System.Design.NativeMethods.POINT pt = new System.Design.NativeMethods.POINT(mouseLoc.X, mouseLoc.Y);
             System.Design.UnsafeNativeMethods.ClientToScreen(new HandleRef(this, this.behaviorService.AdornerWindowControl.Handle), pt);
             if ((pt.x == this.lastMouseAbs.x) && (pt.y == this.lastMouseAbs.y))
             {
                 return true;
             }
         }
         if (!this.dragging)
         {
             if ((Math.Abs((int) (this.initialPoint.X - mouseLoc.X)) <= (DesignerUtils.MinDragSize.Width / 2)) && (Math.Abs((int) (this.initialPoint.Y - mouseLoc.Y)) <= (DesignerUtils.MinDragSize.Height / 2)))
             {
                 return false;
             }
             this.InitiateResize();
             this.dragging = true;
         }
         if ((this.resizeComponents == null) || (this.resizeComponents.Length == 0))
         {
             return false;
         }
         PropertyDescriptor descriptor = null;
         PropertyDescriptor descriptor2 = null;
         PropertyDescriptor descriptor3 = null;
         PropertyDescriptor descriptor4 = null;
         if (this.initialResize)
         {
             descriptor = TypeDescriptor.GetProperties(this.resizeComponents[0].resizeControl)["Width"];
             descriptor2 = TypeDescriptor.GetProperties(this.resizeComponents[0].resizeControl)["Height"];
             descriptor3 = TypeDescriptor.GetProperties(this.resizeComponents[0].resizeControl)["Top"];
             descriptor4 = TypeDescriptor.GetProperties(this.resizeComponents[0].resizeControl)["Left"];
             if ((descriptor != null) && !typeof(int).IsAssignableFrom(descriptor.PropertyType))
             {
                 descriptor = null;
             }
             if ((descriptor2 != null) && !typeof(int).IsAssignableFrom(descriptor2.PropertyType))
             {
                 descriptor2 = null;
             }
             if ((descriptor3 != null) && !typeof(int).IsAssignableFrom(descriptor3.PropertyType))
             {
                 descriptor3 = null;
             }
             if ((descriptor4 != null) && !typeof(int).IsAssignableFrom(descriptor4.PropertyType))
             {
                 descriptor4 = null;
             }
         }
         Control resizeControl = this.resizeComponents[0].resizeControl as Control;
         this.lastMouseLoc = mouseLoc;
         this.lastMouseAbs = new System.Design.NativeMethods.POINT(mouseLoc.X, mouseLoc.Y);
         System.Design.UnsafeNativeMethods.ClientToScreen(new HandleRef(this, this.behaviorService.AdornerWindowControl.Handle), this.lastMouseAbs);
         int num = Math.Max(resizeControl.MinimumSize.Height, 10);
         int num2 = Math.Max(resizeControl.MinimumSize.Width, 10);
         if (this.dragManager != null)
         {
             bool flag2 = true;
             bool shouldSnapHorizontally = true;
             if ((((this.targetResizeRules & SelectionRules.BottomSizeable) != SelectionRules.None) || ((this.targetResizeRules & SelectionRules.TopSizeable) != SelectionRules.None)) && (resizeControl.Height == num))
             {
                 flag2 = false;
             }
             else if ((((this.targetResizeRules & SelectionRules.RightSizeable) != SelectionRules.None) || ((this.targetResizeRules & SelectionRules.LeftSizeable) != SelectionRules.None)) && (resizeControl.Width == num2))
             {
                 flag2 = false;
             }
             PropertyDescriptor descriptor5 = TypeDescriptor.GetProperties(resizeControl)["IntegralHeight"];
             if (descriptor5 != null)
             {
                 object obj2 = descriptor5.GetValue(resizeControl);
                 if ((obj2 is bool) && ((bool) obj2))
                 {
                     shouldSnapHorizontally = false;
                 }
             }
             if (!flag && flag2)
             {
                 this.lastSnapOffset = this.dragManager.OnMouseMove(resizeControl, this.GenerateSnapLines(this.targetResizeRules, mouseLoc), ref this.didSnap, shouldSnapHorizontally);
             }
             else
             {
                 this.dragManager.OnMouseMove(new Rectangle(-100, -100, 0, 0));
             }
             mouseLoc.X += this.lastSnapOffset.X;
             mouseLoc.Y += this.lastSnapOffset.Y;
         }
//.........这里部分代码省略.........
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:101,代码来源:ResizeBehavior.cs


示例14: OnMouseUp

 public override bool OnMouseUp(Glyph g, MouseButtons button)
 {
     _designer.AddPanel(this, EventArgs.Empty);
     return base.OnMouseUp(g, button);
 }
开发者ID:iraychen,项目名称:RibbonControl,代码行数:5,代码来源:RibbonPanelGlyph.cs


示例15: OnMouseDown

 public override bool OnMouseDown(Glyph g, MouseButtons button, Point mouseLoc)
 {
     if (button != MouseButtons.Left)
     {
         return this.pushedBehavior;
     }
     this.targetResizeRules = SelectionRules.None;
     SelectionGlyphBase base2 = g as SelectionGlyphBase;
     if (base2 != null)
     {
         this.targetResizeRules = base2.SelectionRules;
         this.cursor = base2.HitTestCursor;
     }
     if (this.targetResizeRules != SelectionRules.None)
     {
         ISelectionService service = (ISelectionService) this.serviceProvider.GetService(typeof(ISelectionService));
         if (service == null)
         {
             return false;
         }
         this.initialPoint = mouseLoc;
         this.lastMouseLoc = mouseLoc;
         this.primaryControl = service.PrimarySelection as Control;
         ArrayList list = new ArrayList();
         foreach (object obj2 in service.GetSelectedComponents())
         {
             if (obj2 is Control)
             {
                 PropertyDescriptor descriptor = TypeDescriptor.GetProperties(obj2)["Locked"];
                 if ((descriptor == null) || !((bool) descriptor.GetValue(obj2)))
                 {
                     list.Add(obj2);
                 }
             }
         }
         if (list.Count == 0)
         {
             return false;
         }
         this.resizeComponents = new ResizeComponent[list.Count];
         for (int i = 0; i < list.Count; i++)
         {
             this.resizeComponents[i].resizeControl = list[i];
         }
         this.pushedBehavior = true;
         this.BehaviorService.PushCaptureBehavior(this);
     }
     return false;
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:49,代码来源:ResizeBehavior.cs


示例16: OnDragOver

 public override void OnDragOver(Glyph g, DragEventArgs e)
 {
     if (((e != null) && (this.controlRect != Rectangle.Empty)) && !this.controlRect.Contains(new Point(e.X, e.Y)))
     {
         e.Effect = DragDropEffects.None;
     }
     else
     {
         this.designer.OnDragOver(e);
     }
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:11,代码来源:ControlDesigner.cs


示例17: OnGiveFeedback

 public override void OnGiveFeedback(Glyph g, GiveFeedbackEventArgs e)
 {
     this.designer.OnGiveFeedback(e);
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:4,代码来源:ControlDesigner.cs


示例18: OnMouseUp

		public virtual bool OnMouseUp (Glyph g, MouseButtons button)
		{
			throw new NotImplementedException ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:4,代码来源:Behavior.cs


示例19: OnDragLeave

 public override void OnDragLeave(Glyph g, EventArgs e)
 {
     this.controlRect = Rectangle.Empty;
     this.designer.OnDragLeave(e);
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:5,代码来源:ControlDesigner.cs


示例20: OnMouseDoubleClick

 public override bool OnMouseDoubleClick(Glyph g, MouseButtons button, Point mouseLoc)
 {
     this.ignoreNextMouseUp = true;
     return true;
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:5,代码来源:DesignerActionBehavior.cs



注:本文中的System.Windows.Forms.Design.Behavior.Glyph类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Integration.WindowsFormsHost类代码示例发布时间:2022-05-26
下一篇:
C# Charting.Title类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap