Craig Oates
5 years ago
4 changed files with 42 additions and 3 deletions
@ -0,0 +1,42 @@
|
||||
To help you get up to speed on the way Smouldering Beach Ball works, please consider the following image; |
||||
|
||||
IMAGE OF S.B.B. FLOW. |
||||
|
||||
The way it works is you construct a "spec" using the code in "Domain.fs" and pass it to an appropriate function in "Services.fs". From there, "Services.fs" hands it off to "InternalServices.fs". This is after doing some preliminarty checks first. After that, "InternalServices.fs" creates the placeholder image based on the "spec". It is important to note, the output will either be an expection or unit (`()`). |
||||
|
||||
As an aside, I have tried to keep "Domain.fs" and "Services.fs" small. This is because they are the public facing part of the library/NuGet. And, I want to keep S.B.B. easy to integrate into other people's projects. If you do decide to work on this project, please keep this in mind. With that said, I will acknowledge most of the code now resides in "InternalServices.fs" because of it. |
||||
|
||||
## Typical Flow of the System in Code |
||||
|
||||
I though it would would help if I included some code examples with the information above. If all goes well, it should help improve your intution for the project. |
||||
|
||||
```f# |
||||
// Note the Async.RunSynchronously. |
||||
let synchronousFunction width height = |
||||
try |
||||
makeSpec width height |
||||
|> makeImage |
||||
|> Async.RunSynchronously |
||||
with |
||||
| :? ArgumentException as ex -> ex.Message |
||||
| _ as ex -> ex.Message |
||||
|
||||
// Note the Async.Start and one-way of building a spec type. |
||||
let asynchronousFunction width height = |
||||
try |
||||
let oSpec = |
||||
{ colour = Brushes.Black |
||||
overlayType = Full } |
||||
let spec = |
||||
{ width = iWidth |
||||
height = iHeight |
||||
colour = Brushes.AntiqueWhite |
||||
filePath = getDesktopPath |
||||
overlay = Some } |
||||
spec |
||||
|> makeImage |
||||
|> Async.Start |
||||
with |
||||
| :? ArgumentException as ex -> ex.Message |
||||
| _ as ex -> ex.Message |
||||
``` |
Loading…
Reference in new issue