// // Static Methods // static public string[] GetFileNames(string path) { using (var userStorage = new UserStorage()) { return userStorage.GetFiles(path); } }
static public void Delete(string fileName) { using (var userStorage = new UserStorage()) { userStorage.DeleteFile(fileName); } }
static public void WriteLineToFile(string fileName, string line) { using (var userStorage = new UserStorage()) { userStorage.AppendLine(fileName, line); } }
static public string ReadTextFromFile(string fileName) { try { using (var userStorage = new UserStorage()) { lock (_userStoreLock) { if (userStorage.FileExists(fileName)) { return userStorage.ReadText(fileName); } } } } catch (Exception ex) { AppLogs.WriteError("UserStorage.ReadTextFromFile", ex); } return String.Empty; }
static public void WriteTextToFile(string fileName, string text) { using (var userStorage = new UserStorage()) { userStorage.WriteText(fileName, text); } }