示例#1
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            if (e.Args.Length > 1)
            {
                ushort.TryParse(e.Args[1], out _idInitial);
            }

            LayoutModel foundModel = null;

            if (_idInitial != 0)
            {
                foreach (LayoutModel model in ZoneSettings.DefaultModels)
                {
                    if (model.Id == _idInitial)
                    {
                        // found match
                        foundModel = model;
                        break;
                    }
                }

                if (foundModel == null)
                {
                    foreach (LayoutModel model in ZoneSettings.CustomModels)
                    {
                        if (model.Id == _idInitial)
                        {
                            // found match
                            foundModel = model;
                            break;
                        }
                    }
                }
            }

            if (foundModel == null)
            {
                foundModel = ZoneSettings.DefaultModels[0];
            }

            foundModel.IsSelected = true;

            EditorOverlay overlay = new EditorOverlay();

            overlay.Show();
            overlay.DataContext = foundModel;
        }
示例#2
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            if (e.Args.Length > 1)
            {
                UInt16.TryParse(e.Args[1], out _idInitial);
            }

            LayoutModel foundModel = null;

            if (_idInitial != 0)
            {
                foreach (LayoutModel model in _settings.DefaultModels)
                {
                    if (model.Id == _idInitial)
                    {
                        // found match
                        foundModel = model;
                        break;
                    }
                }

                if (foundModel == null)
                {
                    foreach (LayoutModel model in _settings.CustomModels)
                    {
                        if (model.Id == _idInitial)
                        {
                            // found match
                            foundModel = model;
                            break;
                        }
                    }
                }
            }
            if (foundModel == null)
            {
                foundModel = _settings.DefaultModels[0];
            }

            foundModel.IsSelected = true;
            // TODO: multimon
            // Pass in the correct args to show on the desired monitor
            EditorOverlay overlay = new EditorOverlay();

            overlay.Show();
            overlay.DataContext = foundModel;
        }
示例#3
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            RunnerHelper.WaitForPowerToysRunner(Settings.PowerToysPID, () =>
            {
                Environment.Exit(0);
            });

            LayoutModel foundModel = null;

            foreach (LayoutModel model in ZoneSettings.DefaultModels)
            {
                if (model.Type == Settings.ActiveZoneSetLayoutType)
                {
                    // found match
                    foundModel = model;
                    break;
                }
            }

            if (foundModel == null)
            {
                foreach (LayoutModel model in Settings.CustomModels)
                {
                    if ("{" + model.Guid.ToString().ToUpper() + "}" == Settings.ActiveZoneSetUUid.ToUpper())
                    {
                        // found match
                        foundModel = model;
                        break;
                    }
                }
            }

            if (foundModel == null)
            {
                foundModel = ZoneSettings.DefaultModels[0];
            }

            foundModel.IsSelected = true;

            EditorOverlay overlay = new EditorOverlay();

            overlay.Show();
            overlay.DataContext = foundModel;
        }
示例#4
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            WaitForPowerToysRunner();

            LayoutModel foundModel = null;

            foreach (LayoutModel model in ZoneSettings.DefaultModels)
            {
                if (model.Type == Settings.ActiveZoneSetLayoutType)
                {
                    // found match
                    foundModel = model;
                    break;
                }
            }

            if (foundModel == null)
            {
                foreach (LayoutModel model in Settings.CustomModels)
                {
                    if ("{" + model.Guid.ToString().ToUpper() + "}" == Settings.ActiveZoneSetUUid.ToUpper())
                    {
                        // found match
                        foundModel = model;
                        break;
                    }
                }
            }

            if (foundModel == null)
            {
                foundModel = ZoneSettings.DefaultModels[0];
            }

            foundModel.IsSelected = true;

            EditorOverlay overlay = new EditorOverlay();

            overlay.Show();
            overlay.DataContext = foundModel;
        }