Skip to content

Developer notes

kaosborn edited this page Jul 25, 2019 · 6 revisions

Solution layout

All project inputs are contained within the Visual Studio solution. Shared projects are used heavily for source code. The primary reason for using shared projects this way is to eliminate .dll files and reduce the footprint to .exe files only.

Creating new file formats

File formats are defined by convention. At application startup, each public class is examined to see if it qualifies as a known file format. So to create a new file format that is recognized by the diagnostics engine, define a class that follows these rules:

  1. Must be named Model
  2. Must derive from FormatBase.ModelBase
  3. Must contain the property public static string[] SNames { get; }
  4. May contain the property public static string SSubname { get; }
  5. Must be nested. Outer class:
    1. Must end name with Format
    2. Must derive from FormatBase
    3. Must contain the method public static CreateModel (Stream, byte[], string)

For an example of a minimally implemented file format, see the ApeFormat class.

https://github.com/kaosborn/Filebert/blob/master/Source/KaosFormat/Types/ApeFormat.cs

Any changes to the known formats will break test unless ExpectedTypes is also updated.

https://github.com/kaosborn/Filebert/blob/master/TestFull/TestModel.cs

Building

Current builds are produced using Visual Studio 2019 Community Edition although 2017 should work fine too.

https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx

Building the Install project also requires a Microsoft extension:

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects

WpfDiags

The WpfDiags project produces a standalone .NET 4.0 WPF executable. As a WPF application, it will display the default look of its graphical shell.

The architecture of WpfDiags is Model-View-ViewModel (MVVM). No external MVVM framework is referenced by the project. Instead, MVVM application support is provided by the KaosViewModel shared project. MVVM support for the test project is provided by the MockDiagsView class.

Next are the top-level classes of the WpfDiags project.

Next is the domain.

Note: Due to limitations of the Visual Studio class diagram tool, relationships between nested classes are not shown. This limitation is unfortunate because nested classes are used heavily with data binding outer classes containing nested API classes for that target data.

Clone this wiki locally