Beispiel #1
0
 private void SubscribeInteractionProviders()
 {
     _keyboardToken = InteractionManager.GetCommand<SSKeyboardProvider>().Subscribe(OnKeyboardAction);
     _normalizeToken = InteractionManager.GetCommand<SSNormalizeMainWindowProvider>()
         .Subscribe(OnNormalizeWindow);
     _maximazeToken = InteractionManager.GetCommand<SSMaximazeMainWindowProvider>().Subscribe(OnMaximazeWindow);
     _minimazeToken = InteractionManager.GetCommand<SSMinimizeMainWindowProvider>().Subscribe(OnMinimazeWindow);
     _selectionWindowToken =
         InteractionManager.GetCommand<SSSelectedWindowProvider>().Subscribe(OnSelectionWindow);
     _selectionAreaToken = InteractionManager.GetCommand<SSSelectionRegionFinished>().Subscribe(OnSelectionArea);
 }
Beispiel #2
0
        public override void StartSystem()
        {
#if LOCAL_DEBUG
            _mouseHookThread = new Thread(() =>
            {
                _mouseHookThreadId = (uint)SSWindowsFunctions.GetCurrentThreadId();
                using (ProcessModule module = Process.GetCurrentProcess().MainModule)
                {
                    _hhook = SSWindowsFunctions.SetWindowsHookEx(GetHookType(), GetCallback(), SSWindowsFunctions.GetModuleHandle(module.ModuleName), 0);
                }
                uint msg;
                SSWindowsFunctions.GetMessage(out msg, IntPtr.Zero, 0, 0);
            });
            _mouseHookThread.IsBackground = true;
            _mouseHookThread.Start();
#endif
            _selctionAreaToken = InteractionManager.GetCommand <SSSelectionRegionProvider>().Subscribe(OnSelectionArea);
        }
 ///
 /// <param name="token"></param>
 public void Unsubscribe(ISSSubscribeToken token)
 {
     InternalUnsubscribe(token);
 }
 ///
 /// <param name="token"></param>
 protected virtual void InternalUnsubscribe(ISSSubscribeToken token)
 {
     Contract.Requires(token != null);
     Contract.Requires(token.Id != Guid.Empty);
     subscribers.Remove(token);
 }
Beispiel #5
0
 public override void StartSystem()
 {
     base.StartSystem();
     _selctionAreaToken = InteractionManager.GetCommand<SSSelectionRegionProvider>().Subscribe(OnSelectionArea);
 }
 ///
 /// <param name="token"></param>
 protected virtual void InternalUnsubscribe(ISSSubscribeToken token)
 {
     Contract.Requires(token != null);
     Contract.Requires(token.Id != Guid.Empty);
     subscribers.Remove(token);
 }