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); }
public static bool TrackMouseEvent(System.Design.NativeMethods.TRACKMOUSEEVENT tme) { return(_TrackMouseEvent(tme)); }
private void HookMouseEvent() { if (!this.trackingMouseEvent) { this.trackingMouseEvent = true; if (this.trackMouseEvent == null) { this.trackMouseEvent = new System.Design.NativeMethods.TRACKMOUSEEVENT(); this.trackMouseEvent.dwFlags = System.Design.NativeMethods.TME_HOVER; this.trackMouseEvent.hwndTrack = this.adornerWindow.Handle; } System.Design.SafeNativeMethods.TrackMouseEvent(this.trackMouseEvent); } }
private static extern bool _TrackMouseEvent(System.Design.NativeMethods.TRACKMOUSEEVENT tme);