From b754bd9773862e5bafe107586ab9b083fac2fc04 Mon Sep 17 00:00:00 2001 From: seraphima Date: Mon, 18 Mar 2024 21:57:49 +0100 Subject: [PATCH] delete iohelper --- .../editor/FancyZonesEditor/Utils/IOHelper.cs | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/modules/fancyzones/editor/FancyZonesEditor/Utils/IOHelper.cs diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Utils/IOHelper.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Utils/IOHelper.cs deleted file mode 100644 index c3173e8337..0000000000 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Utils/IOHelper.cs +++ /dev/null @@ -1,54 +0,0 @@ -// 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.IO; -using System.IO.Abstractions; -using System.Threading.Tasks; - -namespace Microsoft.FancyZonesEditor.UITests.Utils -{ - public class IOHelper - { - private readonly IFileSystem _fileSystem = new FileSystem(); - - public IOHelper() - { - } - - public void WriteFile(string fileName, string data) - { - _fileSystem.File.WriteAllText(fileName, data); - } - - public string ReadFile(string fileName) - { - if (_fileSystem.File.Exists(fileName)) - { - var attempts = 0; - while (attempts < 10) - { - try - { - using (Stream inputStream = _fileSystem.File.Open(fileName, FileMode.Open)) - using (StreamReader reader = new StreamReader(inputStream)) - { - string data = reader.ReadToEnd(); - inputStream.Close(); - return data; - } - } - catch (Exception) - { - Task.Delay(10).Wait(); - } - - attempts++; - } - } - - return string.Empty; - } - } -}