mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
Severity Code Description Project File Line Suppression State Warning CA1060 Move pinvokes to native methods class PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\App.xaml.cs 24 Active
68 lines
1.9 KiB
C#
68 lines
1.9 KiB
C#
// Copyright (c) Microsoft Corporation
|
|
// 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.Runtime.InteropServices;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using FancyZonesEditor.Models;
|
|
using ManagedCommon;
|
|
|
|
namespace FancyZonesEditor
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for App.xaml
|
|
/// </summary>
|
|
public partial class App : Application
|
|
{
|
|
public Settings ZoneSettings { get; }
|
|
|
|
public App()
|
|
{
|
|
ZoneSettings = new Settings();
|
|
}
|
|
|
|
private void OnStartup(object sender, StartupEventArgs e)
|
|
{
|
|
RunnerHelper.WaitForPowerToysRunner(Settings.PowerToysPID);
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|