Пример #1
0
 private void MonteCarloButton_Click(object sender, RoutedEventArgs e)
 {
     WindowUtility.ShowWindow(this, new MonteCarloSimulationWindow()
     {
         PreviousWindow = new ChooseModeWindow()
     });
 }
Пример #2
0
 public void DrawXMLGenerator(SerializedObject serializedObject)
 {
     WindowUtility.VerticalLayout(() =>
     {
         WindowUtility.Button("Create Mod Template", () => { });
     });
 }
Пример #3
0
 private void AnovaButton_Click(object sender, RoutedEventArgs e)
 {
     WindowUtility.ShowWindow(this, new AnovaWindow()
     {
         PreviousWindow = new ChooseModeWindow()
     });
 }
Пример #4
0
 private void applyStyle()
 {
     if (RuntimePlatform.WindowsPlayer == Application.platform)
     {
         WindowUtility.ApplyWindowsStyle();
     }
 }
Пример #5
0
    public void DrawModSetup(SerializedObject serializedObject)
    {
        WindowUtility.VerticalLayout(() =>
        {
            WindowUtility.Button("Initialize HS2 Map", () => { });
            WindowUtility.Button("Setup Mod Folder", () => { });
        });

        WindowUtility.VerticalLayout(() =>
        {
            GUILayout.Label("Initialize Mod Components");
            WindowUtility.HorizontalLayout(() =>
            {
                WindowUtility.Dropdown("Common", new[]
                {
                    new WindowUtility.DropDownItem {
                        Name = "Hair", On = false, Callback = InitializeObject, Parameter = Command.Hair
                    },
                    new WindowUtility.DropDownItem {
                        Name = "Clothing", On = false, Callback = InitializeObject, Parameter = Command.Clothing
                    },
                    new WindowUtility.DropDownItem {
                        Name = "Accessory/Initialize with Existing N_Move", On = false, Callback = InitializeObject, Parameter = Command.Accessory
                    },
                    new WindowUtility.DropDownItem
                    {
                        Name = "Accessory/Initialize with New N_Move", On = false, Callback = InitializeObject, Parameter = Command.AccessoryWithTransform
                    },
                    new WindowUtility.DropDownItem {
                        Name = "Accessory/Skinned Accessory", On = false, Callback = InitializeObject, Parameter = Command.AccessorySkinned
                    },
                    new WindowUtility.DropDownItem {
                        Name = "Studio Item", On = false, Callback = InitializeObject, Parameter = Command.StudioItem
                    },
                    new WindowUtility.DropDownItem {
                        Name = "Remove All Mod Related Components", On = false, Callback = InitializeObject, Parameter = Command.RemoveAll
                    },
                });

                WindowUtility.Dropdown("HS2", new[]
                {
                    new WindowUtility.DropDownItem {
                        Name = "Playable Map", On = false, Callback = InitializeObject, Parameter = Command.HS2Map
                    },
                });

                WindowUtility.Dropdown("AI", new[]
                {
                    new WindowUtility.DropDownItem {
                        Name = "Furniture Data", On = false, Callback = InitializeObject, Parameter = Command.AIFurniture
                    },
                    new WindowUtility.DropDownItem {
                        Name = "Playable Map", On = false, Callback = InitializeObject, Parameter = Command.AIMap
                    },
                });
            }, false);
        });
    }
Пример #6
0
 void OnWindowDestroyed(IntPtr handle)
 {
     //Event.OBJECT_DESTROY is called for child windows, but handle is still refers to root window,
     //adding this check makes sure we don't remove window prematurely
     if (!WindowUtility.IsDesktopWindow(handle))
     {
         Remove(handle);
     }
 }
 private void NumberOfVariablesButton_Click(object sender, RoutedEventArgs e)
 {
     WindowUtility.ShowWindow(this, new MonteCarloCalculationWindow(false)
     {
         PreviousWindow = new MonteCarloSimulationWindow()
         {
             PreviousWindow = new ChooseModeWindow()
         }
     });
 }
Пример #8
0
        public DesktopWindowCollection() : base(new ObservableCollection <DesktopWindow>())
        {
            //Make sure that the collection is synchronized with ui thread.
            this.SynchronizeWithUIThread();

            //Get existing windows
            AddRange(WindowUtility.Enumerate());

            HookUtility.AddHook(HookUtility.Event.OBJECT_CREATE, Add);
            HookUtility.AddHook(HookUtility.Event.OBJECT_DESTROY, OnWindowDestroyed);

            Poller.Update += Update;
            Update();
        }
Пример #9
0
        public void Show()
        {
            if (_application?.MainWindow != null)
            {
                if (_application.MainWindow.Visibility != Visibility.Visible)
                {
                    WindowUtility.CenterOnFocusedScreen(_application.MainWindow);

                    _application.MainWindow.Topmost = true;
                    _application.MainWindow.Show();
                    _application.MainWindow.Activate();
                    _application.MainWindow.Focus();
                }
            }
        }
Пример #10
0
        public static List <IWindow> GetWindows(this Process process, IProcess typedProcess)
        {
            var output = new List <IWindow>();
            IEnumerable <IntPtr> windows = WindowUtility.GetWindows(process);

            foreach (IntPtr handle in windows)
            {
                string title = WindowUtility.GetWindowTitle(handle);
                if (string.IsNullOrEmpty(title))
                {
                    continue;
                }

                output.Add(new ProcessWindow(typedProcess, handle));
            }

            return(output);
        }
Пример #11
0
 private void CalculateButton_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(MeasurementsCountTextBox.Text) || string.IsNullOrEmpty(SystemsCountTextBox.Text))
     {
         WriteMessageAndClearFields();
     }
     else
     {
         int measurementsCount = int.Parse(MeasurementsCountTextBox.Text);
         int systemsCount      = int.Parse(SystemsCountTextBox.Text);
         AnovaCalculationWindow anovaCalculationWindow = new AnovaCalculationWindow(measurementsCount, systemsCount)
         {
             PreviousWindow = new AnovaWindow()
             {
                 PreviousWindow = new ChooseModeWindow()
             },
         };
         WindowUtility.ShowWindow(this, anovaCalculationWindow);
     }
 }
Пример #12
0
        private void Run()
        {
            try
            {
                while (_isNotDisposed)
                {
                    _newWindowList.Clear();
                    WindowUtility.EnumerateWindows(_newWindowList);
                    // if the hook has been freshly installed
                    // simply copy the new list to the "old" one
                    if (0 == _oldWindowList.Count)
                    {
                        foreach (var tKvp in _newWindowList)
                        {
                            _oldWindowList.Add(tKvp.Key, tKvp.Value);
                        }
                    }
                    else // the hook has been running for some time
                    {
                        FireClosedWindows();
                        FireCreatedWindows();
                    }
                }

                // if the hook has been uninstalled
                // delete the list of old windows
                // because when it is restarted you do not want to get a whole
                // lot of events for windows that where already there

                _oldWindowList.Clear();
                Thread = null;
            }
            catch (Exception aException)
            {
                Console.Out.WriteLine("exception in thread:" + aException);
            }
            Thread = null;
        }
Пример #13
0
        protected override void WndProc(ref Message m)
        {
            Msgs msg = (Msgs)m.Msg;

            if (Program.IsRunning)
            {
                if (msg == Msgs.WM_SIZE)
                {
                    WindowUtility.WndProc(m.HWnd, m.Msg, m.WParam.ToInt32(), m.LParam.ToInt32());
                }
                if (msg == Msgs.WM_DESTROY)
                {
                    Program.Core.RenderEngine.DestroyRenderWindow(renderWindow);
                }
                else if (msg == Msgs.WM_NCCREATE)
                {
                    renderWindow        = Program.Core.RenderEngine.CreateRenderWindow(Handle);
                    renderWindow.Camera = camera;
                }
            }

            base.WndProc(ref m);
        }
 public void ReturnToPreviousWindow()
 {
     WindowUtility.ShowWindow(this, PreviousWindow);
 }
 public void Refresh()
 {
     WindowUtility.ShowWindow(this, new MonteCarloSimulationWindow());
 }
 protected override void OnSourceInitialized(EventArgs e)
 {
     WindowUtility.RemoveWindowIcon(this);
 }
Пример #17
0
 private void onMaxmizeClick()
 {
     WindowUtility.Maximize();
 }
Пример #18
0
 private void onMinimizeClick()
 {
     WindowUtility.Minimize();
 }
Пример #19
0
 public void Refresh()
 {
     WindowUtility.ShowWindow(this, new ChooseModeWindow());
 }
Пример #20
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);

            WindowUtility.RemoveIcon(this);
        }
Пример #21
0
 public void Refresh()
 {
     WindowUtility.ShowWindow(this, new AnovaCalculationWindow(MeasurementsCount, AlternativesCount));
 }