private string GetFolder(StorageFileType fileType) { // TODO: Rewrite var documents = new List <StorageFileType>() { StorageFileType.Pdf, StorageFileType.Msg }; var images = new List <StorageFileType>() { StorageFileType.Jpg, StorageFileType.Png }; var audio = new List <StorageFileType>() { StorageFileType.Mp3 }; if (images.Contains(fileType)) { return("images"); } if (documents.Contains(fileType)) { return("documents"); } if (audio.Contains(fileType)) { return("audio"); } return("other"); }
private Result <string> GetFileExtensin(StorageFileType fileType) { string fileExtension; switch (fileType) { case StorageFileType.Jpeg: fileExtension = ".jpg"; break; default: return(Result <string> .NewFailure($"{nameof(StorageFileType)} '{fileType}' is not supported.")); } return(Result <string> .NewSuccess(fileExtension)); }
public StorageFileSaveModel(string name, StorageFileType fileType, byte[] bytes) { Name = name; FileType = fileType; Bytes = bytes; }