public MyGesture(string id, MyGesture newGesture, MyGesture group) : base(id) { m_action = (BaseActionClass)newGesture.Action.Clone(); m_activator = new MouseActivator(newGesture.m_activator); m_group = group; base.SetItem(newGesture); }
public MyGesture(MyGesture newGesture) : base(newGesture.ID) { m_action = (BaseActionClass)newGesture.Action.Clone(); m_activator = new MouseActivator(newGesture.m_activator); m_group = newGesture.AppGroup; base.SetItem(newGesture); }
private MyGesture(bool isGlobalGroup) : base(TypeOfAction.AppGroupOptions.APP_GROUP_GLOBAL) { m_caption = Languages.Translation.GetText(TypeOfAction.AppGroupOptions.APP_GROUP_GLOBAL); m_action = new AppGroupOptions(AppGroupOptions.APP_GROUP_GLOBAL); m_action.Details = TypeOfAction.AppGroupOptions.APP_GROUP_GLOBAL; m_activator = new MouseActivator(string.Empty, MouseActivator.Types.Undefined); m_group = null; base.SetMainListItem(); }
private static TreeNode GetNode(BaseActionClass action) { TreeNode node = new TreeNode(); node.Text = Languages.Translation.GetText(action.Name); node.Name = action.Name; node.SelectedImageKey = action.Name; node.ImageKey = action.Name; node.Tag = action; return(node); }
public MyGesture(SerializationInfo info, StreamingContext context) : base(info, context) { try { m_action = (BaseActionClass)info.GetValue("Action", typeof(BaseActionClass)); } catch { m_action = new BaseActionClass(); } try { m_activator = (MouseActivator)info.GetValue("Activator", typeof(MouseActivator)); } catch { m_activator = null; } try { m_group = (MyGesture)info.GetValue("Group", typeof(MyGesture)); } catch { m_group = null; } base.SetMainListItem(); m_action.CheckScriptForMouse(); }
private void ExecuteImplicitOnlyAction(BaseActionClass action, KeystrokesOptions.MouseAction mouse, bool selectWnd) { Debug.WriteLine(string.Format("ExecuteImplicitOnlyAction - Action: {0}, Mouse: {1}, SelectWindow: {2} Handle WndUnderCursor: {3}", action.Name, mouse, selectWnd, Config.User.HandleWndUnderCursor)); IntPtr hwnd = m_hwndWindowToUse;//GetWindowToUse(m_cursorPosition); //if (Config.User.handleWndUnderCursor) // hwnd = m_mouse.ActiveWindow; //else // hwnd = m_hwndWndToUse; Point location = new Point(m_cursorPosition.X, m_cursorPosition.Y); lock (this) { m_mouse.StartSimulation(); action.ExecuteKeyScript(mouse, hwnd, selectWnd, location); m_mouse.StopSimulation(); } }
public static TreeNode GetActions(string category, ImageList imgList) { TreeNode node = new TreeNode(); node.Text = Languages.Translation.GetText(category); node.Name = category; node.SelectedImageKey = category; node.ImageKey = category; node.Expand(); string[] actions = InitializeAction(category, category).GetValues(); foreach (string actionName in actions) { BaseActionClass action = InitializeAction(category, actionName); imgList.Images.Add(actionName, action.GetIcon(imgList.ImageSize.Width)); node.Nodes.Add(GetNode(action)); //imgList.Images.Add(action, GetIcon(new Action(action, category))); } //node.Nodes.AddRange(ArrayToNodes(actions)); return(node); }
private static BaseActionClass InitializeAction(string category, string actionName) { BaseActionClass action = null; switch (category) { case InternetOptions.NAME: if (category != actionName) { action = new InternetOptions(actionName); } else { action = new InternetOptions(); } break; case WinampOptions.NAME: if (category != actionName) { action = new WinampOptions(actionName); } else { action = new WinampOptions(); } break; case MediaControl.NAME: if (category != actionName) { action = new MediaControl(actionName); } else { action = new MediaControl(); } break; case WindowOptions.NAME: if (category != actionName) { action = new WindowOptions(actionName); } else { action = new WindowOptions(); } break; case WindowsShell.NAME: if (category != actionName) { action = new WindowsShell(actionName); } else { action = new WindowsShell(); } break; case KeystrokesOptions.NAME: if (category != actionName) { action = new KeystrokesOptions(actionName); } else { action = new KeystrokesOptions(); } break; case SpecialOptions.NAME: if (category != actionName) { action = new SpecialOptions(actionName); } else { action = new SpecialOptions(); } break; case AppGroupOptions.NAME: if (category != actionName) { action = new AppGroupOptions(actionName); } else { action = new AppGroupOptions(); } break; case ExtrasOptions.NAME: if (category != actionName) { action = new ExtrasOptions(actionName); } else { action = new ExtrasOptions(); } break; case VolumeOptions.NAME: if (category != actionName) { action = new VolumeOptions(actionName); } else { action = new VolumeOptions(); } break; default: //if (category != actionName) // action = new BaseActionClass(actionName); //else action = new BaseActionClass(); break; } return(action); }