/// <summary> /// Save a PalasoImage to a file, trying several times if needed. /// </summary> /// <remarks> /// This would logically belong in SIL.Core.IO.RobustIO except that PalasoImage is in SIL.Windows.Forms. /// </remarks> public static void SaveImageRobustly(PalasoImage image, string fileName) { RetryUtility.Retry(() => image.Save(fileName), RetryUtility.kDefaultMaxRetryAttempts, RetryUtility.kDefaultRetryDelay, new HashSet <Type> { Type.GetType("System.IO.IOException"), Type.GetType("System.Runtime.InteropServices.ExternalException") }); }
public static void SavePalasoImage(PalasoImage image, string path) { RetryUtility.Retry(() => image.Save(path)); }