-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
64 lines (56 loc) · 2.68 KB
/
Copy pathProgram.cs
File metadata and controls
64 lines (56 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//*********************************************************************************************************************
// File Name: Program.cs
// Description: Primary class for the Random Number Generator program
//
// Copyright (c) 2022 Mike Pullen
// Licensed under the MIT License. See LICENSE in the repository root.
//
// Revision History:
//====================================================================================================================
// 2022/09/10 - Mike Pullen - Original implementation.
// 2022/10/30 - Mike Pullen - Recreated under VS2022 and added ARM64 support.
// 2024/03/08 - Mike Pullen - Forced simulator mode for the example as the TruRNGpro header was removed due to unclear
// licensing.
// 2026/08/31 - Mike Pullen - Removed the note about forced simulator mode, as the device interface is selected at
// runtime and the simulator is no longer forced.
//*********************************************************************************************************************
using System;
using System.Windows.Forms;
using System.Xml;
namespace RandomNumberGenerator
{
/// <summary>
/// Represents the Random Number Generator program
/// </summary>
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// Setup visual styles
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Create the XML writer and session data file objects
XmlWriterSettings writerSettings = new XmlWriterSettings();
writerSettings.Indent = true;
writerSettings.IndentChars = "\t";
RNGXMLWriter writer = new RNGXMLWriter(writerSettings);
// Create the XML reader for session data loading
RNGXMLReader reader = new RNGXMLReader();
// Create the session data file with both writer and reader capabilities
RNGSessionDataFile sessionDataFile = new RNGSessionDataFile(writer, reader);
// Create the session timer object
RNGSessionTimer sessionTimer = new RNGSessionTimer();
// Create the session data object
RNGSessionData sessionData = new RNGSessionData(sessionDataFile, sessionTimer);
// Create the device interface timer
RNGDeviceTimer deviceTimer = new RNGDeviceTimer();
// Create and run the form
GeneratorForm generatorForm = new GeneratorForm(sessionData, deviceTimer);
Application.Run(generatorForm);
}
}
}