This commit is contained in:
2022-05-08 12:28:50 -07:00
commit 4a3e24236f
313 changed files with 22395 additions and 0 deletions

View File

@ -0,0 +1,27 @@
namespace View_by_Distance.Shared.Models.Stateless.Methods;
internal abstract class Storage
{
// ...
internal static bool WriteAllText(string path, string contents, bool compareBeforeWrite)
{
bool result;
string text;
if (!compareBeforeWrite)
result = true;
else
{
if (!File.Exists(path))
text = string.Empty;
else
text = File.ReadAllText(path);
result = text != contents;
}
if (result)
File.WriteAllText(path, contents);
return result;
}
}