public ExecutionResult Execute(GestureContext context, GestureParser gestureParser) { //Aware接口依赖注入 var contextAware = Command as IGestureContextAware; if (contextAware != null) contextAware.Context = context; var parserAware = this.Command as IGestureParserAware; if (parserAware != null) parserAware.Parser = gestureParser; //在独立线程中运行 //new Thread似乎反应快一点,ThreadPool似乎有延迟 //ThreadPool.QueueUserWorkItem((s) => //new Thread(() => { try { context.ActivateTargetWindow(); Command.Execute(); } catch (Exception) { //ignore errors for now #if DEBUG throw; #endif } }//) { IsBackground = false}.Start(); return new ExecutionResult(null, true); }
public ExecutionResult Execute(GestureContext context, GestureParser gestureParser) { //Aware接口依赖注入 var contextAware = Command as IGestureContextAware; if (contextAware != null) { contextAware.Context = context; } var parserAware = this.Command as IGestureParserAware; if (parserAware != null) { parserAware.Parser = gestureParser; } //var intentStoreAware = Command as IGestureIntentStoreAware; //if (intentStoreAware != null) intentStoreAware.IntentStore = null; var shouldInit = this.Command as INeedInit; if (shouldInit != null && !shouldInit.IsInitialized) { shouldInit.Init(); } //在独立线程中运行 //new Thread似乎反应快一点,ThreadPool似乎有延迟 //ThreadPool.QueueUserWorkItem((s) => //new Thread(() => { try { context.ActivateTargetWindow(); Command.Execute(); using (var proc = Process.GetCurrentProcess()) { Native.SetProcessWorkingSetSize(proc.Handle, -1, -1); } } catch (Exception) { //ignore errors for now #if DEBUG throw; #endif } }//) { IsBackground = false}.Start(); return(new ExecutionResult(null, true)); }
public ExecutionResult Execute(GestureContext context, GestureParser gestureParser) { //Aware接口依赖注入 var contextAware = Command as IGestureContextAware; if (contextAware != null) contextAware.Context = context; var parserAware = this.Command as IGestureParserAware; if (parserAware != null) parserAware.Parser = gestureParser; var shouldInit = this.Command as INeedInit; if (shouldInit != null && !shouldInit.IsInitialized) { shouldInit.Init(); } //在独立线程中运行 //new Thread似乎反应快一点,ThreadPool似乎有延迟 //ThreadPool.QueueUserWorkItem((s) => //new Thread(() => { try { context.ActivateTargetWindow(); Command.Execute(); using (var proc = Process.GetCurrentProcess()) { Native.SetProcessWorkingSetSize(proc.Handle, -1, -1); } } catch (Exception) { //ignore errors for now #if DEBUG throw; #endif } }//) { IsBackground = false}.Start(); return new ExecutionResult(null, true); }
public ExecutionResult Execute(GestureContext context, GestureParser gestureParser) { //Aware接口依赖注入 var contextAware = Command as IGestureContextAware; if (contextAware != null) { contextAware.Context = context; } var parserAware = this.Command as IGestureParserAware; if (parserAware != null) { parserAware.Parser = gestureParser; } //在独立线程中运行 //new Thread似乎反应快一点,ThreadPool似乎有延迟 //ThreadPool.QueueUserWorkItem((s) => new Thread(() => { try { Command.Execute(); } catch (Exception) { //ignore errors for now #if DEBUG throw; #endif } }) { IsBackground = false }.Start(); return(new ExecutionResult(null, true)); }
public BeforePathStartEventArgs(PathEventArgs pathEventArgs) { PathEventArgs = pathEventArgs; Context = pathEventArgs.Context; ShouldPathStart = true; }
public PathEventArgs(Point location, GestureContext context) { Location = location; Context = context; }