Exemple #1
0
 private static IntPtr RegisterHook(LowLevelKeyboardProc proc, HookId hookType)
 {
     using (Process curProcess = Process.GetCurrentProcess())
         using (ProcessModule curModule = curProcess.MainModule)
         {
             return(SetWindowsHookEx((int)hookType, proc,
                                     GetModuleHandle(curModule.ModuleName), 0));
         }
 }
Exemple #2
0
        /// <inheritdoc/>
        protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (Org != null && HookId != null && Hook != null)
            {
                var orgValue    = Org.GetValue(dc.State);
                var hookIdValue = HookId.GetValue(dc.State);
                var hookValue   = Hook.GetValue(dc.State);
                return(await gitHubClient.Organization.Hook.Edit(orgValue, (Int32)hookIdValue, hookValue).ConfigureAwait(false));
            }

            throw new ArgumentNullException("Required [org,hookId,hook] arguments missing for GitHubClient.Organization.Hook.Edit");
        }
Exemple #3
0
        private bool isIdHookVaild(int idHook)
        {
            HookId hi = new HookId();

            foreach (PropertyInfo prop in propertyInfos)
            {
                if (idHook == (int)prop.GetValue(hi, null))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #4
0
        /// <inheritdoc/>
        protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (Owner != null && Name != null && HookId != null)
            {
                var ownerValue  = Owner.GetValue(dc.State);
                var nameValue   = Name.GetValue(dc.State);
                var hookIdValue = HookId.GetValue(dc.State);
                return(gitHubClient.Repository.Hooks.Test(ownerValue, nameValue, (Int32)hookIdValue));
            }
            if (RepositoryId != null && HookId != null)
            {
                var repositoryIdValue = RepositoryId.GetValue(dc.State);
                var hookIdValue       = HookId.GetValue(dc.State);
                return(gitHubClient.Repository.Hooks.Test((Int64)repositoryIdValue, (Int32)hookIdValue));
            }

            throw new ArgumentNullException("Required [hookId] arguments missing for GitHubClient.Repository.Hooks.Test");
        }
Exemple #5
0
 public static extern IntPtr SetWindowsHookEx(HookId idHook, GetMsgProc lpfn, IntPtr hmod, int dwThreadId);
 public static extern IntPtr SetWindowsHookEx(HookId idHook, GetMsgProc lpfn, IntPtr hmod, int dwThreadId);
Exemple #7
0
 public static extern IntPtr SetWindowsHookEx(HookId idHook, Hook lpfn, IntPtr hMod, int dwThreadId);
Exemple #8
0
 public BaseListener(HookId hookId)
 {
     this.hookId = hookId;
 }
Exemple #9
0
 static extern int UnInstallHook(IntPtr hWnd, ref HookId id);
Exemple #10
0
 internal HookBase(HookId hookId) => HookId = hookId;
 private static extern IntPtr SetWindowsHookEx(HookId hookId, HProc hookProc, IntPtr hInstance, Int32 threadId);