/// <summary>
        /// 判断是否在当前的应用程序上禁用的鼠标手势
        /// 如果应用程序没有添加到记录中,则检查全局手是否可用
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public bool IsGesturingEnabledForContext(GestureContext context, out ExeApp foundApp)
        {
            foundApp = GetExeAppByContext(context);

            return foundApp != null ?
                foundApp.IsGesturingEnabled : IntentStore.GlobalApp.IsGesturingEnabled;
        }
Beispiel #2
0
        /// <summary>
        /// 判断是否在当前的应用程序上禁用的鼠标手势
        /// 如果应用程序没有添加到记录中,则检查全局手是否可用
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public bool IsGesturingEnabledForContext(GestureContext context, out ExeApp foundApp)
        {
            foundApp = GetExeAppByContext(context);

            return(foundApp != null ?
                   foundApp.IsGesturingEnabled : IntentStore.GlobalApp.IsGesturingEnabled);
        }
        //private Dictionary<uint, string> _procFileNameDict = new Dictionary<uint, string>(64);

        /// <summary>
        /// Native下以进程文件名为key查找。
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override ExeApp GetExeAppByContext(GestureContext context)
        {
            //全屏模式下禁用

            string str;
            ExeApp found = null;

            var procId = context.ProcId;//Native.GetActiveProcessId();

            Debug.WriteLine("procId=" + procId);


            //if (!_procFileNameDict.TryGetValue(procId, out str))
            //{
            str = Native.GetProcessFile(procId);
            //_procFileNameDict[procId] = str;
            // }

            Debug.WriteLine("Image=" + str);
            if (str == null)
            {
                return(null);
            }

            IntentStore.TryGetExeApp(str, out found);

            return(found);
        }
        //private Dictionary<uint, string> _procFileNameDict = new Dictionary<uint, string>(64);

        /// <summary>
        /// Native下以进程文件名为key查找。
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override ExeApp GetExeAppByContext(GestureContext context)
        {
            //全屏模式下禁用

            string str;
            ExeApp found = null;

            var procId = context.ProcId;//Native.GetActiveProcessId();

            Debug.WriteLine("procId="+procId);


            //if (!_procFileNameDict.TryGetValue(procId, out str))
            //{
                str = Native.GetProcessFile(procId);
                //_procFileNameDict[procId] = str;
           // }

            Debug.WriteLine("Image="+str);
            if (str == null) return null;
            
            IntentStore.TryGetExeApp(str, out found);

            return found;
        }
Beispiel #5
0
        /// <summary>
        /// 判断是否在当前的应用程序上禁用的鼠标手势
        /// 如果应用程序没有添加到记录中,则检查全局手是否可用
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public bool IsGesturingEnabledForContext(GestureContext context)
        {
            var found = GetExeAppByContext(context);

            return(found != null ?
                   found.IsGesturingEnabled : IntentStore.GlobalApp.IsGesturingEnabled);
        }
        /// <summary>
        /// Native下以进程文件名为key查找。
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override ExeApp GetExeAppByContext(GestureContext context)
        {
            //全屏模式下禁用

            string str;
            ExeApp found = null;

            var procId = Native.GetActiveProcessId();


            if (!_procFileNameDict.TryGetValue(procId, out str))
            {
                str = Native.GetProcessFile(procId);
                _procFileNameDict[procId] = str;
            }

            IntentStore.TryGetExeApp(str, out found);

            return(found);
        }
        /// <summary>
        /// 查找Intent
        /// </summary>
        /// <param name="gesture"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public GestureIntent Find(Gesture gesture, GestureContext context)
        {
            var exeApp = GetExeAppByContext(context);
            var globalApp = IntentStore.GlobalApp;

            GestureIntent found;
            
            if (exeApp != null)
            {
                found = exeApp.Find(gesture);
                if (found == null && exeApp.InheritGlobalGestures) //是否继承了全局手势
                {
                    found = globalApp.Find(gesture);
                }
            }else
            {
                found = globalApp.Find(gesture);
            }

            return found;
        }
Beispiel #8
0
        /// <summary>
        /// 查找Intent
        /// </summary>
        /// <param name="gesture"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public GestureIntent Find(Gesture gesture, GestureContext context)
        {
            var exeApp    = GetExeAppByContext(context);
            var globalApp = IntentStore.GlobalApp;

            GestureIntent found;

            if (exeApp != null)
            {
                found = exeApp.Find(gesture);
                if (found == null && exeApp.InheritGlobalGestures) //是否继承了全局手势
                {
                    found = globalApp.Find(gesture);
                }
            }
            else
            {
                found = globalApp.Find(gesture);
            }

            return(found);
        }
 /// <summary>
 /// 实现平台相关的查找
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 public abstract ExeApp GetExeAppByContext(GestureContext context);
Beispiel #10
0
 /// <summary>
 /// 实现平台相关的查找
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 public abstract ExeApp GetExeAppByContext(GestureContext context);