コード例 #1
0
ファイル: Hotkey.cs プロジェクト: mdddev/pass-winmenu
            /// <summary>
            /// Specifies a registrar with which to register the hotkey.
            /// </summary>
            /// <param name="registrar">
            /// The <see cref="IHotkeyRegistrar"/> with which the hotkey is
            /// to be registered. If null, the <see cref="DefaultRegistrar"/>
            /// is used.
            /// </param>
            /// <returns>
            /// A hotkey registered with the specified registrar.
            /// </returns>
            /// <exception cref="HotkeyException">
            /// An error occured in registering the hotkey. Refer to
            /// documentation for the particular <see cref="IHotkeyRegistrar"/>
            /// in use.
            /// </exception>
            /// <exception cref="InvalidOperationException">
            /// A <see cref="Hotkey"/> has already been built.
            /// </exception>
            public Builder For(IHotkeyRegistrar registrar)
            {
                _throwIfBuilt();

                _registrar = registrar ?? DefaultRegistrar;

                return(this);
            }
コード例 #2
0
 public HotkeyUnitTests()
 {
     // Save initial value so we can reset to it between tests
     _defaultRegistrar = Hotkey.DefaultRegistrar;
 }
コード例 #3
0
 /// <summary>
 /// Create a new hotkey manager.
 /// </summary>
 public HotkeyManager()
 {
     registrar = HotkeyRegistrars.Windows;
 }
コード例 #4
0
 public void TestInit()
 {
     _registrar = HotkeyRegistrars.KeyEventSource.Create(_dummyEventSource);
 }
コード例 #5
0
ファイル: Hotkey.cs プロジェクト: mdddev/pass-winmenu
 static Hotkey()
 {
     _defaultRegistrar = HotkeyRegistrars.Windows;
 }
コード例 #6
0
ファイル: Hotkey.cs プロジェクト: mdddev/pass-winmenu
 public HotkeyRegistration(IHotkeyRegistrar registrar)
 {
     _registrar = registrar;
 }