Пример #1
0
        //
        // Static Methods
        //

        static public string[] GetFileNames(string path)
        {
            using (var userStorage = new UserStorage())
            {
                return userStorage.GetFiles(path);
            }
        }
Пример #2
0
 static public void Delete(string fileName)
 {
     using (var userStorage = new UserStorage())
     {
         userStorage.DeleteFile(fileName);
     }
 }
Пример #3
0
 static public void WriteLineToFile(string fileName, string line)
 {
     using (var userStorage = new UserStorage())
     {
         userStorage.AppendLine(fileName, line);
     }
 }
Пример #4
0
 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;
 }
Пример #5
0
 static public void WriteTextToFile(string fileName, string text)
 {
     using (var userStorage = new UserStorage())
     {
         userStorage.WriteText(fileName, text);
     }
 }