mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
Cleanup Editor cmd args (#4022)
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
using FancyZonesEditor.Models;
|
||||
|
||||
|
||||
@@ -21,9 +21,7 @@ namespace FancyZonesEditor
|
||||
{
|
||||
private enum CmdArgs
|
||||
{
|
||||
MonitorHandle = 1,
|
||||
X_Y_Width_Height,
|
||||
ResolutionKey,
|
||||
X_Y_Width_Height = 1,
|
||||
ActiveZoneSetTmpFile,
|
||||
AppliedZoneSetTmpFile,
|
||||
CustomZoneSetsTmpFile,
|
||||
@@ -217,8 +215,6 @@ namespace FancyZonesEditor
|
||||
|
||||
public static Rect WorkArea { get; private set; }
|
||||
|
||||
public static uint Monitor { get; private set; }
|
||||
|
||||
public static string UniqueKey { get; private set; }
|
||||
|
||||
public static string ActiveZoneSetUUid { get; private set; }
|
||||
@@ -246,8 +242,6 @@ namespace FancyZonesEditor
|
||||
|
||||
private static string _customZoneSetsTmpFile;
|
||||
|
||||
public static string WorkAreaKey { get; private set; }
|
||||
|
||||
// UpdateLayoutModels
|
||||
// Update the five default layouts based on the new ZoneCount
|
||||
private void UpdateLayoutModels()
|
||||
@@ -414,16 +408,10 @@ namespace FancyZonesEditor
|
||||
private void ParseCommandLineArgs()
|
||||
{
|
||||
WorkArea = SystemParameters.WorkArea;
|
||||
Monitor = 0;
|
||||
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
if (args.Length == 7)
|
||||
if (args.Length == 5)
|
||||
{
|
||||
if (uint.TryParse(args[(int)CmdArgs.MonitorHandle], out uint monitor))
|
||||
{
|
||||
Monitor = monitor;
|
||||
}
|
||||
|
||||
var parsedLocation = args[(int)CmdArgs.X_Y_Width_Height].Split('_');
|
||||
var x = int.Parse(parsedLocation[0]);
|
||||
var y = int.Parse(parsedLocation[1]);
|
||||
@@ -432,8 +420,6 @@ namespace FancyZonesEditor
|
||||
|
||||
WorkArea = new Rect(x, y, width, height);
|
||||
|
||||
WorkAreaKey = args[(int)CmdArgs.ResolutionKey];
|
||||
|
||||
_activeZoneSetTmpFile = args[(int)CmdArgs.ActiveZoneSetTmpFile];
|
||||
_appliedZoneSetTmpFile = args[(int)CmdArgs.AppliedZoneSetTmpFile];
|
||||
_customZoneSetsTmpFile = args[(int)CmdArgs.CustomZoneSetsTmpFile];
|
||||
|
||||
Reference in New Issue
Block a user