From 981d632468312e0fc3a8aea3825e7b042cd4e49c Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 31 Dec 2018 15:15:47 +0000 Subject: [PATCH] change Validation to ValidationServices. --- DeathSocket/DeathSocket.fsproj | 2 +- DeathSocket/GridPainter.fs | 2 +- DeathSocket/ImageServices.fs | 2 +- DeathSocket/ScratchPad.fsx | 4 ++-- DeathSocket/Validation.fs | 39 ---------------------------------- 5 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 DeathSocket/Validation.fs diff --git a/DeathSocket/DeathSocket.fsproj b/DeathSocket/DeathSocket.fsproj index 6500931..077a558 100644 --- a/DeathSocket/DeathSocket.fsproj +++ b/DeathSocket/DeathSocket.fsproj @@ -23,7 +23,7 @@ - + diff --git a/DeathSocket/GridPainter.fs b/DeathSocket/GridPainter.fs index f109803..cd4479d 100644 --- a/DeathSocket/GridPainter.fs +++ b/DeathSocket/GridPainter.fs @@ -13,7 +13,7 @@ namespace DeathSocket /// functions. module GridPainter = - open Validation + open ValidationServices open ImageServices open SkiaSharp diff --git a/DeathSocket/ImageServices.fs b/DeathSocket/ImageServices.fs index dd5c295..4c1ae10 100644 --- a/DeathSocket/ImageServices.fs +++ b/DeathSocket/ImageServices.fs @@ -5,7 +5,7 @@ open System.Drawing open System.Drawing.Imaging open DeathSocket - open Validation + open ValidationServices open ColourServices open SkiaSharp diff --git a/DeathSocket/ScratchPad.fsx b/DeathSocket/ScratchPad.fsx index 5e24201..274d958 100644 --- a/DeathSocket/ScratchPad.fsx +++ b/DeathSocket/ScratchPad.fsx @@ -4,7 +4,7 @@ //#r @"C:/Users/craig/.nuget/packages/skiasharp/1.60.3/runtimes/win-x64/native/libSkiaSharp.dll" #load "Domain.fs" -#load "Validation.fs" +#load "ValidationServices.fs" #load "ColourServices.fs" #load "ImageServices.fs" #load "GridPainter.fs" @@ -12,7 +12,7 @@ open System open System.Drawing open SkiaSharp -open Validation +open ValidationServices open ImageServices open DeathSocket diff --git a/DeathSocket/Validation.fs b/DeathSocket/Validation.fs deleted file mode 100644 index 8e3f707..0000000 --- a/DeathSocket/Validation.fs +++ /dev/null @@ -1,39 +0,0 @@ -module internal Validation - - open System.IO - open DeathSocket - - 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." - | _ -> () - - let validateLongestDimension pDims aDims = - let width = (fst pDims) - (fst aDims) - let height = (snd pDims) - (snd aDims) - match width >= height with - | true -> Width - | false -> Height \ No newline at end of file