/// <summary> /// Perform the operation - page through the list, /// activate a window etc /// </summary> /// <param name="itemTag">Meta data about seleted item</param> private void handleSelect(ItemTag itemTag) { switch (itemTag.DataType) { case ItemTag.ItemType.NextPage: gotoNextPage(); break; case ItemTag.ItemType.PreviousPage: gotoPreviousPage(); break; case ItemTag.ItemType.OrderBy: switchSortOrder(); break; case ItemTag.ItemType.Window: if (itemTag.WInfo != null) { if (!User32Interop.IsWindow(itemTag.WInfo.Handle) || !User32Interop.IsWindowVisible(itemTag.WInfo.Handle)) { DialogUtils.ShowTimedDialog(this, "Window does not exist"); } else if (DialogUtils.ConfirmScanner("Switch to " + itemTag.WInfo.Title + "?")) { if (EvtActivateWindow != null) { EvtActivateWindow.BeginInvoke(this, itemTag.WInfo, null, null); } } } break; } }
/// <summary> /// User selected a window to switch to. Trigger an event /// to indicate this. /// </summary> /// <param name="wInfo">Window info of the window selected</param> private void handleWindowSelect(EnumWindows.WindowInfo wInfo) { if (!User32Interop.IsWindow(wInfo.Handle) || !User32Interop.IsWindowVisible(wInfo.Handle)) { DialogUtils.ShowTimedDialog(this, R.GetString("WindowNotFound")); } else if (DialogUtils.ConfirmScanner(String.Format(R.GetString("ConfirmSwitchToWindow"), wInfo.Title))) { if (EvtActivateWindow != null) { EvtActivateWindow.BeginInvoke(this, wInfo, null, null); } } }
/// <summary> /// User selected a window to switch to. Trigger an event /// to indicate this. /// </summary> /// <param name="wInfo">Window info of the window selected</param> private void handleWindowSelect(EnumWindows.WindowInfo wInfo) { if (!User32Interop.IsWindow(wInfo.Handle) || !User32Interop.IsWindowVisible(wInfo.Handle)) { DialogUtils.ShowTimedDialog(this, Resources.WindowDoesNotExist); } else if (DialogUtils.ConfirmScanner(string.Format(Resources.SwitchTo, wInfo.Title))) { if (EvtActivateWindow != null) { EvtActivateWindow.BeginInvoke(this, wInfo, null, null); } } }
/// <summary> /// User selected a window to switch to. Trigger an event /// to indicate this. /// </summary> /// <param name="wInfo">Window info of the window selected</param> private void handleWindowSelect(EnumWindows.WindowInfo wInfo) { if (!User32Interop.IsWindow(wInfo.Handle) || !User32Interop.IsWindowVisible(wInfo.Handle)) { DialogUtils.ShowTimedDialog(this, "Window does not exist"); } else if (DialogUtils.ConfirmScanner("Switch to " + wInfo.Title + "?")) { if (EvtActivateWindow != null) { EvtActivateWindow.BeginInvoke(this, wInfo, null, null); } } }