[FZEditor]Fix missing file error message regression (#32088)

This commit is contained in:
Seraphima Zykova
2024-03-26 22:11:18 +01:00
committed by GitHub
parent 0a316370d8
commit 88c2f3022a

View File

@@ -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)
{