public FileLoggingService(string name) { _name = name; _folderPath = FileSystemManager.ConstructFullPath(new[] { "logs", "records" }); _logFile = fileName + DateTime.Now.ToString("yyyy_MM_dd") + ".rec"; Framework.Files.FileSystemManager.EnsureDirectoryCreated(_folderPath); Framework.Files.FileSystemManager.EnsureFileCreated(Framework.Files.FileSystemManager.Combine(_folderPath, _logFile)); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (!(value is string path) || String.IsNullOrEmpty(path) || !(parameter is string storagePath)) { var platform = (Xamarin.Forms.OnPlatform <string>)Application.Current.Resources["FontAwesomeRegular"]; var color = (Color)Application.Current.Resources["SecondaryColor"]; string family = platform; return(new FontImageSource { FontFamily = family, Size = 25, Glyph = Helpers.FontAwesomeIconFont.Circle, Color = color }); } var arr = storagePath.Split(Core.Constants.Separator.ToCharArray()); var dirPath = FileSystemManager.ConstructFullPath(arr); var fullPath = FileSystemManager.Combine(dirPath, path); var source = ImageSource.FromFile(fullPath); return(source); }