public void PrintChildren(IntPtr hWnd) { for (int s = 0; s < c; s++) { output.Write(" "); } PrintWindow(hWnd, IntPtr.Zero); IntPtr child = WindowAction.GetWindow(hWnd, WindowAction.GW_CHILD); if (child != null && child != IntPtr.Zero) { c++; for (IntPtr chWnd = WindowAction.GetWindow(child, WindowAction.GW_HWNDFIRST); chWnd != IntPtr.Zero; chWnd = WindowAction.GetWindow(chWnd, WindowAction.GW_HWNDNEXT)) { if (!WindowAction.IsValidWindow(chWnd)) { continue; } PrintChildren(chWnd); } c--; } }
public WindowActionEventArgs(RoutedEvent routedEvent, WindowAction action, Point?location = null, DockableGroup controls = null, PeekSide?side = null) : base(routedEvent) { Action = action; Location = location; DockableControls = controls; Side = side; }
private static WindowAction OpenPerformanceTrackerWindowAction() { var action = WindowAction.CreateWindowMenuItem("OpenPerformanceTrackerWindow", (v, a) => { OpenPerformanceTrackerWindow(v.GetType().Name, Analytics.ActionSource.EditorWindowMenu); }, "Window Performance/Open Performance Tracker Window"); return(action); }
static WindowAction RenderDocGlobalAction() { // Developer-mode render doc button to enable capturing any HostView content/panels var action = WindowAction.CreateWindowActionButton("RenderDoc", CaptureRenderDocFullContent, null, ContainerWindow.kButtonWidth + 1, RenderDocCaptureButton); action.validateHandler = ShowRenderDocButton; return(action); }
private WindowEvent CreateWindowEvent(Window window, WindowAction action) { var windowEvent = Create <WindowEvent>(); windowEvent.Window = window.GetName(); windowEvent.Action = action; return(windowEvent); }
//method that takes List and delegate variable public static List <Window> DoSomeOperation(List <Window> window, WindowAction <Window> operation) { for (int i = 0; i < window.Count; i++) { window[i] = operation(window[i]); } return(window); }
//another method for delegate with another data type public static int[] PrintMassive(int[] massive, WindowAction <int> del) { foreach (var val in massive) { del(val); } return(massive); }
private static WindowAction OpenProfilerAction() { var action = WindowAction.CreateWindowMenuItem("OpenProfilerForWindow", (v, a) => { OpenProfiler(PerformanceTrackerMonitoringService.GetWindowPaintMarker(v), Analytics.ActionSource.EditorWindowMenu); }, "Window Performance/Open Profiler"); return(action); }
private static WindowAction OpenBugReportingToolAction() { var action = WindowAction.CreateWindowMenuItem("OpenBugReportingTool", (v, a) => { OpenBugReportingTool(PerformanceTrackerMonitoringService.GetWindowPaintMarker(v), Analytics.ActionSource.EditorWindowMenu); }, "Window Performance/Report Performance Bug"); return(action); }
private void PrintTopLevelWindows() { WriteLine("Printing top windows...(FILTER <...>)"); GCHandle gch = GCHandle.Alloc(windows); WindowAction.EnumWindowsProc callback = new WindowAction.EnumWindowsProc(PrintWindow); WindowAction.EnumWindows(callback, (IntPtr)gch); }
internal static void Invoke(WindowAction action) { mutex.WaitOne(); if (activity_stack.Count > 0) { XobotWindow window = (XobotWindow)activity_stack.Peek().getWindow(); action(window); } mutex.ReleaseMutex(); }
internal static bool RenderDocCaptureButton(EditorWindow view, WindowAction self, Rect r) { if (s_RenderDocContent == null) { s_RenderDocContent = EditorGUIUtility.TrIconContent("renderdoc", UnityEditor.RenderDocUtil.openInRenderDocLabel); } Rect r2 = new Rect(r.xMax - r.width, r.y, r.width, r.height); return(GUI.Button(r2, s_RenderDocContent, EditorStyles.iconButton)); }
public void Do(WindowAction action) { if (this.OfType <NotificationAction>().Any()) { if (new[] { WindowAction.Refresh, WindowAction.CloseModalRefreshParent }.Contains(action)) { NotificationAction.ScheduleForNextRequest(); } } Add(new { BrowserAction = action.ToString() }); }
protected JsonResult Do(WindowAction action) { if (Actions.OfType <NotificationAction>().Any()) { if (new[] { WindowAction.Refresh, WindowAction.CloseModalRefreshParent }.Contains(action)) { NotificationAction.ScheduleForNextRequest(Actions); } } return(AddAction(new { BrowserAction = action.ToString() })); }
internal static WindowEventAction FromProto(WindowAction action) { return(action switch { WindowAction.Unknown => WindowEventAction.Unknown, WindowAction.Focused => WindowEventAction.Focused, WindowAction.Unfocused => WindowEventAction.Unfocused, WindowAction.Opened => WindowEventAction.Opened, WindowAction.Closed => WindowEventAction.Closed, WindowAction.TitleChanged => WindowEventAction.TitleChanged, WindowAction.Moved => WindowEventAction.Moved, WindowAction.Resized => WindowEventAction.Resized, _ => throw new ArgumentOutOfRangeException(nameof(action), action, null) });
private static void ShowTheOne() { WindowAction.PostMessage((IntPtr)HWND_BROADCAST, WM_SHOW_PLUGSTER, IntPtr.Zero, IntPtr.Zero); //Process current = Process.GetCurrentProcess(); //foreach (Process process in Process.GetProcessesByName(current.ProcessName)) //{ // if (process.Id != current.Id) // { // SetForegroundWindow(process.MainWindowHandle); // break; // } //} }
private void windowAction(WindowAction action) { if (action == Workspace.WindowAction.Close) { Window.GetWindow(this).Close(); } else if (action == Workspace.WindowAction.Maximize) { Window.GetWindow(this).WindowState = (Window.GetWindow(this).WindowState == WindowState.Normal) ? WindowState.Maximized : WindowState.Normal; } else if (action == Workspace.WindowAction.Minimize) { Window.GetWindow(this).WindowState = WindowState.Minimized; } }
private static WindowAction StartProfilerRecordingEditorAction() { var action = WindowAction.CreateWindowMenuItem("StartProfilerRecordingEditor", (window, _action) => { // We need to fix this!! See var marker = PerformanceTrackerMonitoringService.GetWindowPaintMarker(window); ProfilerHelpers.OpenProfiler(marker, profilerWindow => { ProfilerHelpers.SetRecordingEnabled(profilerWindow, true); ProfilerHelpers.StartProfilerRecording("", true, ProfilerDriver.deepProfiling); }); }, "Window Performance/Start Profiler Recording"); return(action); }
/// <summary> /// 打开界面对外接口 /// </summary> /// <param name="type"></param> /// <param name="param"></param> /// <param name="go"></param> public static void ManageWinwodOpen(WindowAction type, object param = null, GameObject go = null) { WindowActionParameter para = new WindowActionParameter(type, param, go); switch (para.type) { case WindowAction.Open_UICombatReadiness: OpenWindow <UICombatReadiness>(UIFilePath.UICombatReadiness, WindowType.Full); break; case WindowAction.Open_UIBattle: UIBattle ub = OpenWindow <UIBattle>(UIFilePath.UIBattle, WindowType.Full); para.go = ub.gameObject; break;; } }
public override void ExecuteThis() { windows.Clear(); WriteLine("PID <WINDOW PROCESS ID>" + " : TID <WINDOW THREAD ID>" + " : PNAME <WINDOW PROCESS NAME>" + " : CLSNAME <CLASSNAME>" + " : HWNDI <WINDOW HANDLE INT>" + " : HWNDX <WINDOW HANDLE HEX>" + "\n"); if (allTopWins.BoolValue) { PrintTopLevelWindows(); } else { System.Drawing.Point pt = new System.Drawing.Point(xyParam.X, xyParam.Y); WriteLine("Window at " + pt); IntPtr hWnd = WindowAction.WindowFromPoint(pt); if (!BeSilent) { Utils.HighlightWindow(hWnd); } PrintWindow(hWnd, IntPtr.Zero); if (printParent.BoolValue) { WriteLine("\nPrinting Parent hierarchy..."); IntPtr parent = hWnd; while (parent != null && parent != IntPtr.Zero) { PrintWindow(parent, IntPtr.Zero); parent = WindowAction.GetAncestor(parent, WindowAction.GA_PARENT); } } if (printChildren.BoolValue) { WriteLine("\nPrinting Children hierarchy..."); PrintChildren(hWnd); } } }
private void DetermineAction(WindowAction actionType) { switch (actionType) { case WindowAction.CloseAll: action = w => GUIManager.CloseAllWindows(); break; case WindowAction.OpenAdditive: action = w => GUIManager.OpenWindow(w); break; case WindowAction.OpenSingle: action = w => GUIManager.OpenOnlyWindow(w); break; case WindowAction.OpenRecentlyClosed: action = w => GUIManager.OpenRecentlyClosedWindows(); break; case WindowAction.OpenOnlyRecentlyClosed: action = w => GUIManager.OpenOnlyRecentlyClosedWindows(); break; case WindowAction.OpenPreviouslyOpen: action = w => GUIManager.OpenPreviouslyOpenWindows(); break; case WindowAction.OpenOnlyPreviouslyOpen: action = w => GUIManager.OpenOnlyPreviouslyOpenWindows(); break; case WindowAction.Close: action = w => GUIManager.CloseWindow(w); break; case WindowAction.Toggle: action = w => GUIManager.ToggleWindow(w); break; case WindowAction.None: action = w => { }; break; default: throw new NotImplementedException(actionType.ToString()); } }
public void ToExecuteHelper() { dynamic form = Activator.CreateInstance(AbstractDeckAction.FindType("DisplayButtons.Forms.EventSystem.EventCreateNew")) as Form; // form.comboBox.Visible = false; form.Controls.Remove(form.comboBox); var instance = new WindowAction(this); form.UpdateForm(instance, 1); if (form.ShowDialog() == DialogResult.OK) { folder = (DynamicDeckFolder)instance.comboBox1.SelectedItem; } else { form.Close(); } }
/// <summary> /// ウィンドウ操作を実行します。 /// </summary> /// <param name="action">実行するウィンドウ操作。</param> /// <param name="source">操作を実行しようとしている UI 要素。この要素をホストするウィンドウに対し、<paramref name="action"/> 操作が実行されます。</param> public static void Invoke(this WindowAction action, FrameworkElement source) { var window = Window.GetWindow(source); if (window == null) { return; } switch (action) { case WindowAction.Active: window.Activate(); break; case WindowAction.Close: SystemCommands.CloseWindow(window); break; case WindowAction.Maximize: SystemCommands.MaximizeWindow(window); break; case WindowAction.Minimize: SystemCommands.MinimizeWindow(window); break; case WindowAction.Normalize: SystemCommands.RestoreWindow(window); break; case WindowAction.OpenSystemMenu: var point = source.PointToScreen(new Point(0, source.ActualHeight)); SystemCommands.ShowSystemMenu(window, point); break; } }
private void Fire(Window window, WindowAction action) { var windowEvent = CreateWindowEvent(window, action); FireNow(windowEvent); }
/// <summary> /// Executed when mouse left button is down. /// </summary> /// <param name="e">The data for the event.</param> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); windowAction = WindowAction.None; if (windowState == WindowState.Normal) { // Stop inertial motion before the mouse is captured StopInertialMotion(); clickPoint = e.GetPosition(HostPanel); clickWindowPosition = Position; snapinController.SnapinDistance = this.FloatingWindowHost.SnapinDistance; snapinController.SnapinMargin = this.FloatingWindowHost.SnapinMargin; snapinController.SnapinEnabled = this.FloatingWindowHost.SnapinEnabled; if (ResizeEnabled && resizeController.CanResize) { snapinController.SnapinBounds = this.FloatingWindowHost.GetSnapinBounds(this); resizeController.StartResizing(); CaptureMouseCursor(); windowAction = WindowAction.Resize; } else if (chrome != null) { // If the mouse was clicked on the chrome - start dragging the window Point point = e.GetPosition(chrome); if (chrome.ContainsPoint(point)) { snapinController.SnapinBounds = this.FloatingWindowHost.GetSnapinBounds(this); CaptureMouseCursor(); windowAction = WindowAction.Move; inertiaController.StartMotion(Position); } } } }
/// <summary> /// Executed when mouse left button is up. /// </summary> /// <param name="e">The data for the event.</param> protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { base.OnMouseLeftButtonUp(e); if (windowAction == WindowAction.Move) { InertialMotion motion = inertiaController.GetInertialMotionParameters( this.FloatingWindowHost.HostPanel.GetActualBoundingRectangle(), this.BoundingRectangle); if (motion != null) { windowAction = WindowAction.InertialMotion; contentRoot.AnimateTranslateTransform(inertialMotionStoryboard, motion.EndPosition, motion.Seconds, motion.EasingFunction); } } if (isMouseCaptured) { contentRoot.ReleaseMouseCapture(); isMouseCaptured = false; } if (windowAction != WindowAction.InertialMotion) windowAction = WindowAction.None; }
public object param; //根据界面不同传入不同参数 public WindowActionParameter(WindowAction type, object param = null, GameObject go = null) { this.type = type; this.go = go; this.param = param; }
public WindowActionMessage(WindowAction action,string messageKey) : this(messageKey) { Action = action; }
internal static void Invoke (WindowAction action) { mutex.WaitOne (); if (activity_stack.Count > 0) { XobotWindow window = (XobotWindow)activity_stack.Peek ().getWindow (); action (window); } mutex.ReleaseMutex (); }
private static void CaptureRenderDocFullContent(EditorWindow view, WindowAction self) { view.m_Parent.CaptureRenderDocFullContent(); }
private static bool ShowRenderDocButton(EditorWindow view, WindowAction self) { return(Unsupported.IsDeveloperMode() && IsLoaded() && IsSupported()); }
protected void SendWindowAction(WindowAction action) { this.Messenger.Raise(new WindowActionMessage(action, "Window.WindowAction")); }
private static Activity GetMainWindowActivity(WindowAction action) { return(action == WindowAction.Activate ? Activity.EnterIDE : Activity.LeaveIDE); }
public WindowActionMessage(WindowAction action) : this(action,null) { }
public WindowButtonActionEventArgs(WindowAction action) { Action = action; }
protected JsonResult Do(WindowAction action) { JavascriptActions.Do(action); return(JsonActions()); }
/// <summary> /// Handles the Completed event of the InertialMotionStoryboard. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void InertialMotion_Completed(object sender, EventArgs e) { // Save current window position reading it from the TranslateTransform object Position = GetCurrentWindowPosition(); // Stop the animation affecting its target property inertialMotionStoryboard.Remove(contentRoot as FrameworkElement); windowAction = WindowAction.None; }