コード例 #1
0
ファイル: ThemedTextBox.cs プロジェクト: daiybh/Codist
 public ThemedTextBox(bool captureFocus)
     : this()
 {
     if (captureFocus == false)
     {
         return;
     }
     _thief = new KeystrokeThief(CodistPackage.OleComponentManager);
 }
コード例 #2
0
ファイル: KeystrokeThief.cs プロジェクト: wangjieest/Codist
        public static void Bind(Window window)
        {
            var componentManager = ServiceProvider.GetGlobalServiceAsync <SOleComponentManager, IOleComponentManager>().Result;
            var thief            = new KeystrokeThief(componentManager);

            new System.Windows.Interop.WindowInteropHelper(window).Owner = new IntPtr(CodistPackage.DTE.MainWindow.HWnd);
            window.Activated   += (s, args) => thief.StartStealing();
            window.Deactivated += (s, args) => thief.StopStealing();
            window.Closed      += (s, args) => thief.StopStealing();
        }
コード例 #3
0
ファイル: KeystrokeThief.cs プロジェクト: alekseyaz/Codist
        public static void Bind(Window window)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            var componentManager = ServiceProvider.GetGlobalServiceAsync <SOleComponentManager, IOleComponentManager>().Result;
            var thief            = new KeystrokeThief(componentManager);

            // window.Owner = Application.Current.MainWindow;
            window.Activated   += (s, args) => thief.StartStealing();
            window.Deactivated += (s, args) => thief.StopStealing();
            window.Closed      += (s, args) => thief.StopStealing();
        }