Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
add - Added missing documentation
Browse files Browse the repository at this point in the history
---

We've added missing documentation to several public classes and functions.

---

Type: add
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 23, 2023
1 parent 6a1f2a6 commit 0dba7b9
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 15 deletions.
2 changes: 1 addition & 1 deletion GRILO.Bootloader/BootApps/BootLoadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace GRILO.Bootloader.BootApps
{
public class BootLoadContext : AssemblyLoadContext
internal class BootLoadContext : AssemblyLoadContext
{
internal AssemblyDependencyResolver resolver;
internal string bootPath = "";
Expand Down
8 changes: 4 additions & 4 deletions GRILO.Bootloader/BootApps/BootLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

namespace GRILO.Bootloader.BootApps
{
public class BootLoader : MarshalByRefObject
internal class BootLoader : MarshalByRefObject
{
public byte[] bytes = Array.Empty<byte>();
public string lookupPath = "";
public bool shutting = false;
internal byte[] bytes = Array.Empty<byte>();

public void ProxyExecuteBootable(params string[] args)
internal void ProxyExecuteBootable(params string[] args)
{
AppDomain.CurrentDomain.AssemblyResolve += this.ResolveDependency;
var asm = Assembly.Load(bytes);
Expand All @@ -55,7 +55,7 @@ public void ProxyExecuteBootable(params string[] args)
shutting = proxy.ShutdownRequested;
}

public bool VerifyBoot(byte[] bootBytes)
internal bool VerifyBoot(byte[] bootBytes)
{
AppDomain.CurrentDomain.AssemblyResolve += this.ResolveDependency;
var asm = Assembly.Load(bootBytes);
Expand Down
2 changes: 1 addition & 1 deletion GRILO.Bootloader/BootApps/BootProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace GRILO.Bootloader.BootApps
{
public class BootProxy : IBootable
internal class BootProxy : IBootable
{
internal BootLoader loader = null;

Expand Down
18 changes: 18 additions & 0 deletions GRILO.Bootloader/BootStyle/BaseBootStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,33 @@

namespace GRILO.Bootloader.BootStyle
{
/// <summary>
/// Base boot style
/// </summary>
public abstract class BaseBootStyle : IBootStyle
{
/// <inheritdoc/>
public abstract Dictionary<ConsoleKeyInfo, Action<BootAppInfo>> CustomKeys { get; }

/// <inheritdoc/>
public abstract void Render();

/// <inheritdoc/>
public abstract void RenderHighlight(int chosenBootEntry);

/// <inheritdoc/>
public abstract void RenderModalDialog(string content);

/// <inheritdoc/>
public abstract void RenderBootingMessage(string chosenBootName);

/// <inheritdoc/>
public abstract void RenderBootFailedMessage(string content);

/// <inheritdoc/>
public abstract void RenderSelectTimeout(int timeout);

/// <inheritdoc/>
public abstract void ClearSelectTimeout();
}
}
4 changes: 4 additions & 0 deletions GRILO.Bootloader/BootStyle/BootStyleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ public static void RenderBootFailedMessage(string content)
Input.DetectKeypress();
}

/// <summary>
/// Renders the selection timeout
/// </summary>
/// <param name="timeout">Timeout interval in seconds</param>
public static void RenderSelectTimeout(int timeout)
{
if (!timeoutThread.IsAlive && timeout > 0 && GRILO.waitingForFirstBootKey)
Expand Down
3 changes: 3 additions & 0 deletions GRILO.Bootloader/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public static class Config
{
internal static ConfigInstance instance = new();

/// <summary>
/// Configuration instance
/// </summary>
public static ConfigInstance Instance =>
instance;

Expand Down
21 changes: 21 additions & 0 deletions GRILO.Bootloader/Configuration/Instance/ConfigInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,44 @@

namespace GRILO.Bootloader.Configuration.Instance
{
/// <summary>
/// Configuration instance
/// </summary>
public class ConfigInstance
{
/// <summary>
/// The boot style name
/// </summary>
[JsonProperty("Boot style", Required = Required.Always)]
public string BootStyleName { get; set; } = "Default";

/// <summary>
/// Whether to create a file containing diagnostic messages
/// </summary>
[JsonProperty("Diagnostic messages", Required = Required.Always)]
public bool DiagnosticMessages { get; set; }

/// <summary>
/// Whether to also print diagnostic messages to the console
/// </summary>
[JsonProperty("Print diagnostic messages to console", Required = Required.Always)]
public bool PrintDiagnosticMessages { get; set; }

/// <summary>
/// Additional bootable folders to scan for bootable applications
/// </summary>
[JsonProperty("Additional bootable folders", Required = Required.Always)]
public string[] AdditionalScanFolders { get; set; } = Array.Empty<string>();

/// <summary>
/// Timeout to boot to the default selection
/// </summary>
[JsonProperty("Timeout to boot to selection", Required = Required.Always)]
public int BootSelectTimeoutSeconds { get; set; } = 10;

/// <summary>
/// The default boot entry selection. This number is zero-based, so the first element is index 0, and so on.
/// </summary>
[JsonProperty("Default boot entry selection", Required = Required.Always)]
public int BootSelect { get; set; } = 0;
}
Expand Down
30 changes: 21 additions & 9 deletions GRILO.Bootloader/GRILOException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,28 @@ namespace GRILO.Bootloader
/// </summary>
public class GRILOException : Exception
{
public GRILOException() : base("Unknown bootloader error!")
{
}
/// <summary>
/// Makes a new instance of GRILO exception
/// </summary>
public GRILOException() :
base("Unknown bootloader error!")
{ }

public GRILOException(string message) : base("Internal bootloader error: " + message)
{
}
/// <summary>
/// Makes a new instance of GRILO exception
/// </summary>
/// <param name="message">Error message to use while creating a new instance of the exception</param>
public GRILOException(string message) :
base("Internal bootloader error: " + message)
{ }

public GRILOException(string message, Exception innerException) : base("Internal bootloader error: " + message, innerException)
{
}
/// <summary>
/// Makes a new instance of GRILO exception
/// </summary>
/// <param name="message">Error message to use while creating a new instance of the exception</param>
/// <param name="innerException">Inner exception to use</param>
public GRILOException(string message, Exception innerException) :
base("Internal bootloader error: " + message, innerException)
{ }
}
}
3 changes: 3 additions & 0 deletions GRILO.Bootloader/GRILOPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

namespace GRILO.Bootloader
{
/// <summary>
/// Platform helpers
/// </summary>
public static class GRILOPlatform
{
/// <summary>
Expand Down

0 comments on commit 0dba7b9

Please sign in to comment.