Example #1
0
        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--;
            }
        }
Example #2
0
 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;
 }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        private WindowEvent CreateWindowEvent(Window window, WindowAction action)
        {
            var windowEvent = Create <WindowEvent>();

            windowEvent.Window = window.GetName();
            windowEvent.Action = action;
            return(windowEvent);
        }
Example #6
0
 //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);
 }
Example #7
0
 //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);
 }
Example #8
0
        private static WindowAction OpenProfilerAction()
        {
            var action = WindowAction.CreateWindowMenuItem("OpenProfilerForWindow", (v, a) => {
                OpenProfiler(PerformanceTrackerMonitoringService.GetWindowPaintMarker(v), Analytics.ActionSource.EditorWindowMenu);
            }, "Window Performance/Open Profiler");

            return(action);
        }
Example #9
0
        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);
        }
Example #10
0
        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);
        }
Example #11
0
 internal static void Invoke(WindowAction action)
 {
     mutex.WaitOne();
     if (activity_stack.Count > 0)
     {
         XobotWindow window = (XobotWindow)activity_stack.Peek().getWindow();
         action(window);
     }
     mutex.ReleaseMutex();
 }
Example #12
0
        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));
        }
Example #13
0
        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() });
        }
Example #14
0
        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() }));
        }
Example #15
0
 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)
     });
Example #16
0
        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;
            //    }
            //}
        }
Example #17
0
 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;
     }
 }
Example #18
0
        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);
        }
Example #19
0
    /// <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;;
        }
    }
Example #20
0
        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());
            }
        }
Example #22
0
        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();
            }
        }
Example #23
0
        /// <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;
            }
        }
Example #24
0
        private void Fire(Window window, WindowAction action)
        {
            var windowEvent = CreateWindowEvent(window, action);

            FireNow(windowEvent);
        }
Example #25
0
        /// <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);
                    }
                }
            }
        }
Example #26
0
        /// <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;
        }
Example #27
0
    public object param;      //根据界面不同传入不同参数

    public WindowActionParameter(WindowAction type, object param = null, GameObject go = null)
    {
        this.type  = type;
        this.go    = go;
        this.param = param;
    }
Example #28
0
 public WindowActionMessage(WindowAction action,string messageKey)
     : this(messageKey)
 {
     Action = action;
 }
Example #29
0
		internal static void Invoke (WindowAction action)
		{
			mutex.WaitOne ();
			if (activity_stack.Count > 0) {
				XobotWindow window = (XobotWindow)activity_stack.Peek ().getWindow ();
				action (window);
			}
			mutex.ReleaseMutex ();
		}
Example #30
0
 private static void CaptureRenderDocFullContent(EditorWindow view, WindowAction self)
 {
     view.m_Parent.CaptureRenderDocFullContent();
 }
Example #31
0
 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"));
 }
Example #33
0
 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);
 }
Example #35
0
 public WindowActionMessage(WindowAction action)
     : this(action,null)
 {
 }
 public WindowButtonActionEventArgs(WindowAction action)
 {
     Action = action;
 }
Example #37
0
 protected JsonResult Do(WindowAction action)
 {
     JavascriptActions.Do(action);
     return(JsonActions());
 }
Example #38
0
        /// <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;
        }