module internal ValidationServices open System.IO let validateFilePath path = match File.Exists path with | true -> () | false -> raise (new FileNotFoundException ("No file found at " + path)) let validateSaveFileType file = match Path.GetExtension file with | ".jpg" -> () | ".JPG" -> () | ".png" -> () | ".PNG" -> () | _ -> invalidArg "savePath" "The file type must be a .jpg or .png file." let validateIO iPath oPath = validateFilePath iPath validateSaveFileType oPath let validateDimensions dimensions = match dimensions with | (0, _) -> invalidArg "Width" "Width must be greater than 0." | (_, 0) -> invalidArg "Height" "Height must be greater than 0." | (_, _) -> () let validateLineThickness thickness = match thickness with | thickness when thickness <= 0.0 -> invalidArg "LineThickness" "LineThickness must be greater than 0." | _ -> ()