From d098f126915e1c2596b2b2e0312553428e820c7b Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Thu, 20 Sep 2018 22:20:54 +0100 Subject: [PATCH] add listAllColours function to lib and rename applyGrid to async. --- DeathSocket/GridPainter.fs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/DeathSocket/GridPainter.fs b/DeathSocket/GridPainter.fs index 088c846..c87cb28 100644 --- a/DeathSocket/GridPainter.fs +++ b/DeathSocket/GridPainter.fs @@ -6,12 +6,22 @@ namespace DeathSocket open Validation open ImageServices + open System.Drawing + open System.Reflection - let applyGrid spec = + let applyGridAsync spec = async { try validateFilePath |> ignore drawGrid spec |> ignore with - | :? FileNotFoundException as ex -> printfn "File could not be found at %s" ex.Message - } \ No newline at end of file + | :? FileNotFoundException as ex -> + printfn "File could not be found at %s" ex.Message + } + + let ListAllColours = + let properties = + typeof.GetProperties + (BindingFlags.Public ||| BindingFlags.Static) + seq { for prop in properties -> prop } + |> Seq.toList \ No newline at end of file