100 lines
2.7 KiB
C#
100 lines
2.7 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace DevDrive;
|
|
|
|
/// <summary>
|
|
/// Represents the index.json configuration file structure.
|
|
/// </summary>
|
|
public class DevDriveConfig
|
|
{
|
|
/// <summary>
|
|
/// Display name for the drive.
|
|
/// </summary>
|
|
[JsonPropertyName("driveName")]
|
|
public string DriveName { get; set; } = "Dev Drive";
|
|
|
|
/// <summary>
|
|
/// Icon path in format "path,index" (e.g. "%SystemRoot%\System32\shell32.dll,8").
|
|
/// </summary>
|
|
[JsonPropertyName("driveIcon")]
|
|
public string DriveIcon { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Total drive capacity in MB (for display purposes).
|
|
/// </summary>
|
|
[JsonPropertyName("driveTotalMB")]
|
|
public double DriveTotalMB { get; set; } = 1.44;
|
|
|
|
/// <summary>
|
|
/// Free space in MB (for display purposes).
|
|
/// </summary>
|
|
[JsonPropertyName("driveFreeMB")]
|
|
public double DriveFreeMB { get; set; } = 0.72;
|
|
|
|
/// <summary>
|
|
/// List of symlink entries to create in the drive root.
|
|
/// </summary>
|
|
[JsonPropertyName("paths")]
|
|
public List<SymlinkEntry> Paths { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// List of applications to prompt for launch after mounting.
|
|
/// </summary>
|
|
[JsonPropertyName("startupApps")]
|
|
public List<StartupApp> StartupApps { get; set; } = [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents a single symlink entry.
|
|
/// </summary>
|
|
public class SymlinkEntry
|
|
{
|
|
/// <summary>
|
|
/// Name of the symlink (folder/file name in the drive).
|
|
/// </summary>
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Target path the symlink points to.
|
|
/// </summary>
|
|
[JsonPropertyName("path")]
|
|
public string Path { get; set; } = string.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents an application to launch after mounting.
|
|
/// </summary>
|
|
public class StartupApp
|
|
{
|
|
/// <summary>
|
|
/// Display name shown in the dialog.
|
|
/// </summary>
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Path to the executable.
|
|
/// </summary>
|
|
[JsonPropertyName("path")]
|
|
public string Path { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Command line arguments (optional).
|
|
/// </summary>
|
|
[JsonPropertyName("arguments")]
|
|
public string Arguments { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Working directory (optional, defaults to executable's directory).
|
|
/// </summary>
|
|
[JsonPropertyName("workingDirectory")]
|
|
public string WorkingDirectory { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Whether this app is checked by default in the dialog.
|
|
/// </summary>
|
|
[JsonPropertyName("checkedByDefault")]
|
|
public bool CheckedByDefault { get; set; } = true;
|
|
}
|