mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[FZEditor]Fix missing file error message regression (#32088)
This commit is contained in:
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Windows;
|
||||
using FancyZonesEditor.Models;
|
||||
@@ -153,10 +154,13 @@ namespace FancyZonesEditor.Utils
|
||||
try
|
||||
{
|
||||
LayoutHotkeys parser = new LayoutHotkeys();
|
||||
if (!File.Exists(parser.File))
|
||||
{
|
||||
return new ParsingResult(true);
|
||||
}
|
||||
|
||||
var layoutHotkeys = parser.Read(parser.File);
|
||||
|
||||
bool layoutHotkeysParsingResult = SetLayoutHotkeys(layoutHotkeys);
|
||||
|
||||
if (!layoutHotkeysParsingResult)
|
||||
{
|
||||
return new ParsingResult(false, FancyZonesEditor.Properties.Resources.Error_Parsing_Layout_Hotkeys_Message);
|
||||
@@ -178,8 +182,12 @@ namespace FancyZonesEditor.Utils
|
||||
try
|
||||
{
|
||||
LayoutTemplates parser = new LayoutTemplates();
|
||||
var templates = parser.Read(parser.File);
|
||||
if (!File.Exists(parser.File))
|
||||
{
|
||||
return new ParsingResult(true);
|
||||
}
|
||||
|
||||
var templates = parser.Read(parser.File);
|
||||
bool parsingResult = SetTemplateLayouts(templates.LayoutTemplates);
|
||||
if (parsingResult)
|
||||
{
|
||||
@@ -202,8 +210,12 @@ namespace FancyZonesEditor.Utils
|
||||
try
|
||||
{
|
||||
CustomLayouts parser = new CustomLayouts();
|
||||
var wrapper = parser.Read(parser.File);
|
||||
if (!File.Exists(parser.File))
|
||||
{
|
||||
return new ParsingResult(true);
|
||||
}
|
||||
|
||||
var wrapper = parser.Read(parser.File);
|
||||
bool parsingResult = SetCustomLayouts(wrapper.CustomLayouts);
|
||||
if (parsingResult)
|
||||
{
|
||||
@@ -226,8 +238,12 @@ namespace FancyZonesEditor.Utils
|
||||
try
|
||||
{
|
||||
DefaultLayouts parser = new DefaultLayouts();
|
||||
var wrapper = parser.Read(parser.File);
|
||||
if (!File.Exists(parser.File))
|
||||
{
|
||||
return new ParsingResult(true);
|
||||
}
|
||||
|
||||
var wrapper = parser.Read(parser.File);
|
||||
bool parsingResult = SetDefaultLayouts(wrapper.DefaultLayouts);
|
||||
if (parsingResult)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user