Added configurators
This commit is contained in:
11
src/HopFrame.Core/Configuration/HopFrameConfig.cs
Normal file
11
src/HopFrame.Core/Configuration/HopFrameConfig.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace HopFrame.Core.Configuration;
|
||||
|
||||
/**
|
||||
* The configuration for the library
|
||||
*/
|
||||
public sealed class HopFrameConfig {
|
||||
/** The configurations for the table repositories */
|
||||
public IList<TableConfig> Tables { get; set; } = new List<TableConfig>();
|
||||
|
||||
internal HopFrameConfig() {}
|
||||
}
|
||||
41
src/HopFrame.Core/Configuration/PropertyConfig.cs
Normal file
41
src/HopFrame.Core/Configuration/PropertyConfig.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace HopFrame.Core.Configuration;
|
||||
|
||||
/**
|
||||
* The configuration for a single property
|
||||
*/
|
||||
public class PropertyConfig {
|
||||
/** The unique identifier for the property (usually the real property name in the model) */
|
||||
public required string Identifier { get; init; }
|
||||
|
||||
/** The displayed name of the Property */
|
||||
public required string DisplayName { get; set; }
|
||||
|
||||
/** The type of the property */
|
||||
public required Type Type { get; set; }
|
||||
|
||||
/** Determines if the property will appear in the table */
|
||||
public bool Listable { get; set; } = true;
|
||||
|
||||
/** Determines if the table can be sorted by the property */
|
||||
public bool Sortable { get; set; } = true;
|
||||
|
||||
/** Determines if the table can be searched by the property */
|
||||
public bool Searchable { get; set; } = true;
|
||||
|
||||
/**
|
||||
* Determines if the value of the property can be edited
|
||||
* (if true the value can still be set during creation)
|
||||
*/
|
||||
public bool Editable { get; set; } = true;
|
||||
|
||||
/** Determines if the property is visible in the creation or edit dialog */
|
||||
public bool Creatable { get; set; } = true;
|
||||
|
||||
/** Determines if the actual value should be displayed (useful for passwords) */
|
||||
public bool DisplayValue { get; set; } = true;
|
||||
|
||||
/** The place (from left to right) that the property will appear in the table and editor */
|
||||
public int OrderIndex { get; set; }
|
||||
|
||||
internal PropertyConfig() {}
|
||||
}
|
||||
32
src/HopFrame.Core/Configuration/TableConfig.cs
Normal file
32
src/HopFrame.Core/Configuration/TableConfig.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace HopFrame.Core.Configuration;
|
||||
|
||||
/**
|
||||
* The configuration for a table
|
||||
*/
|
||||
public class TableConfig {
|
||||
/** The unique identifier for the table (usually the name of the model) */
|
||||
public required string Identifier { get; init; }
|
||||
|
||||
/** The configurations for the properties of the model */
|
||||
public IList<PropertyConfig> Properties { get; set; } = new List<PropertyConfig>();
|
||||
|
||||
/** The type of the model */
|
||||
public required Type TableType { get; set; }
|
||||
|
||||
/** The type identifier for the repository */
|
||||
public required Type RepositoryType { get; set; }
|
||||
|
||||
/** the url of the table page */
|
||||
public required string Route { get; set; }
|
||||
|
||||
/** The displayed name of the table */
|
||||
public required string DisplayName { get; set; }
|
||||
|
||||
/** A short description for the table */
|
||||
public string? Description { get; set; }
|
||||
|
||||
/** The place (from top to bottom) that the table will appear in on the sidebar */
|
||||
public int OrderIndex { get; set; }
|
||||
|
||||
internal TableConfig() {}
|
||||
}
|
||||
Reference in New Issue
Block a user