示例#1
0
        /// <summary>
        /// Executes method in thread. This method ends immediatly.
        /// </summary>
        /// <param name="method">Method or list of overloads to execute.</param>
        /// <param name="rawParams">Parameter list convertible to at least one method overload.</param>
        /// <returns>Thread where execution runs on.</returns>
        public Thread Execute(MethodOverloads method, params object[] rawParams)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            return(ThreadStarter.StartBackround(new ExecuteWorkerDelegate(ExecuteWorker), method, rawParams));
        }
示例#2
0
文件: Hotkeys.cs 项目: byterj/phoenix
        public void Exec(string shortcut)
        {
            lock (syncRoot) {
                CommandList cmdList;

                if (hotkeys.TryGetValue(shortcut, out cmdList))
                {
                    ThreadStarter.StartBackround(new WorkerDelegate(Worker), shortcut, cmdList);
                }
                else
                {
                    UO.PrintError("Hotkey {0} not found.", shortcut);
                }
            }
        }