public void ShowHighLightItem(string itemGuid, string itemParentGuid, Action <IBasicData, bool> restoration = null, IBasicData restorationData = null, bool v = false, bool firstTime = true) { WinAPI.SetFocus(ControlUI.corelHandle); WinAPI.SetForegroundWindow(ControlUI.corelHandle); Corel.Interop.VGCore.cdrWindowState state = corelApp.AppWindow.WindowState; if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized || state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMinimized) { corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized; } if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore) { corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore; } if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal) { corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal; } //corelApp.AppWindow.Activate(); System.Windows.Rect rect = this.GetItemRect(itemParentGuid, itemGuid); if (rect.IsZero()) { //if (firstTime) // ShowHighLightItem(itemGuid, itemParentGuid, restoration, restorationData, v, false); //else //{ //core.DispactchNewMessage("Don't can find the control, maybe is does not visible", MsgType.Console); return; //} } core.DispactchNewMessage(DateTime.Now.ToLongTimeString(), MsgType.Console); core.SetUIVisible = false; //tagWindow.Visibility = win.Visibility.Collapsed; if (corelApp.AppWindow.WindowState == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized) { form = new OverlayForm(rect); } else { System.Windows.Rect rect2 = new System.Windows.Rect(corelApp.AppWindow.Left, corelApp.AppWindow.Top, corelApp.AppWindow.Width, corelApp.AppWindow.Height); form = new OverlayForm(rect, rect2); } //Thread.Sleep(1000); CallForm(); }
private void LoadHighLightForm(IBasicData itemData, IBasicData parentItemData, IBasicData specialData, win.DependencyObject dependencyObject) { WinAPI.SetFocus(ControlUI.corelHandle); WinAPI.SetForegroundWindow(ControlUI.corelHandle); Corel.Interop.VGCore.cdrWindowState state = corelApp.AppWindow.WindowState; corelApp.AppWindow.Activate(); if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized || state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMinimized) { corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized; } if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore) { corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore; } if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal) { corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal; } System.Windows.Rect rect = this.GetItemRect(parentItemData.Guid, itemData.Guid); if (rect.IsZero()) { return; } Views.XMLTagWindow w = Core.FindParentControl <Views.XMLTagWindow>(dependencyObject) as Views.XMLTagWindow; w.Visibility = win.Visibility.Collapsed; OverlayForm form; if (corelApp.AppWindow.WindowState == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized) { form = new OverlayForm(rect); } else { System.Windows.Rect rect2 = new System.Windows.Rect(corelApp.AppWindow.Left, corelApp.AppWindow.Top, corelApp.AppWindow.Width, corelApp.AppWindow.Height); form = new OverlayForm(rect, rect2); } form.Show(); form.FormClosed += (s, e) => { w.Visibility = win.Visibility.Visible; if (specialData != null) { if (specialData.GetType() == typeof(CommandBarData)) { } if (specialData.GetType() == typeof(DockerData)) { corelApp.FrameWork.HideDocker(specialData.Guid); } if (specialData.GetType() == typeof(DialogData)) { #if !X7 corelApp.FrameWork.HideDialog(specialData.Guid); #endif } } }; }