public virtual int TranslateAccelerator(ref System.Design.NativeMethods.MSG msg, ref Guid group, int nCmdID) { return(0); }
public bool DoBeginDrag(object[] components, SelectionRules rules, int initialX, int initialY) { if (((rules & SelectionRules.AllSizeable) != SelectionRules.None) || (Control.MouseButtons == MouseButtons.None)) { return true; } Control designerControl = this.client.GetDesignerControl(); this.localDrag = true; this.localDragInside = false; this.dragComps = components; this.dragBase = new Point(initialX, initialY); this.localDragOffset = Point.Empty; designerControl.PointToClient(new Point(initialX, initialY)); DragDropEffects allowedEffects = DragDropEffects.Move | DragDropEffects.Copy; for (int i = 0; i < components.Length; i++) { InheritanceAttribute attribute = (InheritanceAttribute) TypeDescriptor.GetAttributes(components[i])[typeof(InheritanceAttribute)]; if (!attribute.Equals(InheritanceAttribute.NotInherited) && !attribute.Equals(InheritanceAttribute.InheritedReadOnly)) { allowedEffects &= ~DragDropEffects.Move; allowedEffects |= 0x4000000; } } DataObject data = new ComponentDataObjectWrapper(new ComponentDataObject(this.client, this.serviceProvider, components, initialX, initialY)); System.Design.NativeMethods.MSG msg = new System.Design.NativeMethods.MSG(); while (System.Design.NativeMethods.PeekMessage(ref msg, IntPtr.Zero, 15, 15, 1)) { System.Design.NativeMethods.TranslateMessage(ref msg); System.Design.NativeMethods.DispatchMessage(ref msg); } bool freezePainting = OleDragDropHandler.freezePainting; AddCurrentDrag(data, this.client.Component); ArrayList allowDropCache = new ArrayList(); foreach (object obj3 in components) { Control control2 = obj3 as Control; if ((control2 != null) && control2.HasChildren) { this.DisableDragDropChildren(control2.Controls, allowDropCache); } } DragDropEffects none = DragDropEffects.None; IDesignerHost host = this.GetService(typeof(IDesignerHost)) as IDesignerHost; DesignerTransaction transaction = null; if (host != null) { transaction = host.CreateTransaction(System.Design.SR.GetString("DragDropDragComponents", new object[] { components.Length })); } try { none = designerControl.DoDragDrop(data, allowedEffects); if (transaction != null) { transaction.Commit(); } } finally { RemoveCurrentDrag(data); foreach (Control control3 in allowDropCache) { control3.AllowDrop = true; } OleDragDropHandler.freezePainting = freezePainting; if (transaction != null) { ((IDisposable) transaction).Dispose(); } } bool flag3 = (((none & DragDropEffects.Move) != DragDropEffects.None) || ((none & 0x4000000) != DragDropEffects.None)) && this.localDragInside; ISelectionUIService service = (ISelectionUIService) this.GetService(typeof(ISelectionUIService)); if ((service != null) && service.Dragging) { service.EndDrag(!flag3); } if (!this.localDragOffset.IsEmpty && (none != DragDropEffects.None)) { this.DrawDragFrames(this.dragComps, this.localDragOffset, this.localDragEffect, Point.Empty, DragDropEffects.None, false); } this.localDragOffset = Point.Empty; this.dragComps = null; this.localDrag = this.localDragInside = false; this.dragBase = Point.Empty; return false; }
public virtual int TranslateAccelerator(ref System.Design.NativeMethods.MSG lpmsg, short wID) { return(1); }