imeplement all Dialog-API functions

This commit is contained in:
Gregor Biswanger
2017-10-17 22:28:43 +02:00
parent 28dab9866d
commit 072a24d091
8 changed files with 273 additions and 7 deletions

View File

@@ -0,0 +1,55 @@
namespace ElectronNET.API.Entities
{
public class Certificate
{
/// <summary>
/// PEM encoded data
/// </summary>
public string Data { get; set; }
/// <summary>
/// Fingerprint of the certificate
/// </summary>
public string Fingerprint { get; set; }
/// <summary>
/// Issuer principal
/// </summary>
public CertificatePrincipal Issuer { get; set; }
/// <summary>
/// Issuer certificate (if not self-signed)
/// </summary>
public Certificate IssuerCert { get; set; }
/// <summary>
/// Issuer's Common Name
/// </summary>
public string IssuerName { get; set; }
/// <summary>
/// Hex value represented string
/// </summary>
public string SerialNumber { get; set; }
/// <summary>
/// Subject principal
/// </summary>
public CertificatePrincipal Subject { get; set; }
/// <summary>
/// Subject's Common Name
/// </summary>
public string SubjectName { get; set; }
/// <summary>
/// End date of the certificate being valid in seconds
/// </summary>
public int ValidExpiry { get; set; }
/// <summary>
/// Start date of the certificate being valid in seconds
/// </summary>
public int ValidStart { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
namespace ElectronNET.API.Entities
{
public class CertificatePrincipal
{
/// <summary>
/// Common Name
/// </summary>
public string CommonName { get; set; }
/// <summary>
/// Country or region
/// </summary>
public string Country { get; set; }
/// <summary>
/// Locality
/// </summary>
public string Locality { get; set; }
/// <summary>
/// Organization names
/// </summary>
public string[] Organizations { get; set; }
/// <summary>
/// Organization Unit names
/// </summary>
public string[] OrganizationUnits { get; set; }
/// <summary>
/// State or province
/// </summary>
public string State { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace ElectronNET.API.Entities
{
public class CertificateTrustDialogOptions
{
/// <summary>
/// The certificate to trust/import.
/// </summary>
public Certificate Certificate { get; set; }
/// <summary>
/// The message to display to the user.
/// </summary>
public string Message { get; set; }
}
}

View File

@@ -0,0 +1,52 @@
using ElectronNET.API.Entities;
namespace ElectronNET.API
{
public class SaveDialogOptions
{
public string Title { get; set; }
/// <summary>
/// Absolute directory path, absolute file path, or file name to use by default.
/// </summary>
public string DefaultPath { get; set; }
/// <summary>
/// Custom label for the confirmation button, when left empty the default label will
/// be used.
/// </summary>
public string ButtonLabel { get; set; }
/// <summary>
/// The filters specifies an array of file types that can be displayed or
/// selected when you want to limit the user to a specific type. For example:
/// </summary>
/// <example>
/// <code>
/// new FileFilter[]
/// {
/// new FileFiler { Name = "Images", Extensions = new string[] { "jpg", "png", "gif" } },
/// new FileFiler { Name = "Movies", Extensions = new string[] { "mkv", "avi", "mp4" } },
/// new FileFiler { Name = "Custom File Type", Extensions= new string[] {"as" } },
/// new FileFiler { Name = "All Files", Extensions= new string[] { "*" } }
/// }
/// </code>
/// </example>
public FileFilter[] Filters { get; set; }
/// <summary>
/// Message to display above text fields.
/// </summary>
public string Message { get; set; }
/// <summary>
/// Custom label for the text displayed in front of the filename text field.
/// </summary>
public string NameFieldLabel { get; set; }
/// <summary>
/// Show the tags input box, defaults to true.
/// </summary>
public bool ShowsTagField { get; set; }
}
}