create D.S. Main Files Page.

master
Craig Oates 5 years ago
parent
commit
a71b84a21e
  1. 1
      DeathSocket-Home.md
  2. 58
      DeathSockets-Main-Files-Overview.md
  3. 1
      Home.md
  4. 1
      Source-Code-Home.md
  5. 1
      _sidebar.md

1
DeathSocket-Home.md

@ -6,5 +6,6 @@ This section focuses on the source code within the project called "DeathSocket".
## Table of Contents
- [DeathSocket Project Breakdown](DeathSocket-Project-Breakdown)
- [DeathSocket's Main Files Overview](DeathSockets-Main-Files-Overview.md)
- [DeathSocket's Flow](DeathSockets-Flow)
- [DeathSocket's Internal Flow](DeathSockets-Internal-Flow)

58
DeathSockets-Main-Files-Overview.md

@ -0,0 +1,58 @@
Instead of running through every line of code in the project, I will provide a summary of what each file aims to do. That way, you should find how the pieces fit together in a more intuitive way. That's the plan at least.
## GridPainter.fs (public)
Name-space: `DeathSocket`
This is the public facing part of the library, the API. When people add this project to theirs, they will call the functions in here. Which, in turn, will call the `internal` functions within the rest of the library. End-users will use this file and the types defined in "Domain.fs" extensively.
- [GridPainter.fs](https://gitlab.com/craig.oates/Death-Socket/blob/master/DeathSocket/GridPainter.fs)
## ValidationServices.fs (internal)
Name-space: `ValidationServices`
The functions is this file perform validation checks -- as the name implies. File extension and path checks are examples of the types of checks found in here.
- [ValidationServices.fs](https://gitlab.com/craig.oates/Death-Socket/blob/master/DeathSocket/ValidationServices.fs)
## ColourServices.fs (internal)
Name-space: `ColourServices`
This file deals with converting/creating `Colors` and `Brushes` which are used to draw the grid. The colours and brushes are derived from the `System.Drawing` name-space.
There are no functions for the *SkiaSharp* part of the library because it does not have a notion of `Brushes` like `System.Drawing`. So, I have found little need to add any functions for this part of library in here.
If you are unfamiliar with either *System.Drawing* or *SkiaSharp*, please use the following links;
- [System.Drawing](https://docs.microsoft.com/en-us/dotnet/api/system.drawing?view=netframework-4.8)
- [SkiaSharp](https://github.com/mono/SkiaSharp)
It is, also, worth pointing out the .Net Framework provides a name-space called `System.Media`. The `Colors` and `Brushes` in here are **not** compatible or interchangeable with `System.Drawing`. 
If you're wondering, I decided to go with `System.Drawing`, instead of `system.media`, because is works better with Windows Presentation Foundation (W.P.F.).
- [ColourServices.fs](https://gitlab.com/craig.oates/Death-Socket/blob/master/DeathSocket/ColourServices.fs)
## ImagePrep.fs
Name-space: `ImagePrep`
This file provides functions which aids the functions in "ImageServices.fs". Within this file, you will find the *SkiaSharp* functions separated from the *System.Drawing* ones via comments. The functions not grouped together via those comments work with both libraries/name-spaces.
- [ImagePrep.fs](https://gitlab.com/craig.oates/Death-Socket/blob/master/DeathSocket/ImagePrep.fs)
## ImageServices.fs (internal)
Name-space: `ImageServices`
This file focuses on creating and saving the new image, with its grid. You will see **a** lot of duplicated code in here but do not worry too much. There are comments within the file explaining the rationale behind it. The short version why is to reduce the memory footprint of the library at run-time. I decided to solve this by utilising the `use` keyword. This means I do not need to manually dispose of images which reduces the chances of memory leaks. The result of this is duplicated but self-contained (I.E. function bound/scoped) code.
If you are unsure what the `use` keyword does, please you the following link for more information;
- [F# `use` keyword](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/resource-management-the-use-keyword)
Like "ImagePrep.fs", this file separates the *System.Drawing* and *SkiaSharp* based functions with comments.
- [ImageServices.fs](https://gitlab.com/craig.oates/Death-Socket/blob/master/DeathSocket/ImageServices.fs)

1
Home.md

@ -57,6 +57,7 @@ Before continuing, I recommend you are familiar with the following;
- [DeathSocket Home](DeathSocket-Home)
- [DeathSocket Project Breakdown](DeathSocket-Project-Breakdown)
- [DeathSocket's Main Files Overview](DeathSockets-Main-Files-Overview.md)
- [DeathSocket's Flow](DeathSockets-Flow)
- [DeathSocket's Internal Flow](DeathSockets-Internal-Flow)

1
Source-Code-Home.md

@ -12,6 +12,7 @@ This section is for those wanting to work with the repository's source code. If
- [DeathSocket Home](DeathSocket-Home)
- [DeathSocket Project Breakdown](DeathSocket-Project-Breakdown)
- [DeathSocket's Main Files Overview](DeathSockets-Main-Files-Overview.md)
- [DeathSocket's Flow](DeathSockets-Flow)
- [DeathSocket's Internal Flow](DeathSockets-Internal-Flow)

1
_sidebar.md

@ -14,6 +14,7 @@
- [DeathSocket Home](DeathSocket-Home)
- [DeathSocket Project Breakdown](DeathSocket-Project-Breakdown)
- [DeathSocket's Main Files Overview](DeathSockets-Main-Files-Overview.md)
- [DeathSocket's Flow](DeathSockets-Flow)
- [DeathSocket's Internal Flow](DeathSockets-Internal-Flow)

Loading…
Cancel
Save