Class Element
An object which is identified with a unique identifier and a name.
Inheritance
System.Object
Element
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
[JsonConverter(typeof(JsonInheritanceConverter), new object[]{"discriminator"})]
public abstract class Element : INotifyPropertyChanged
Constructors
Element(Guid, String)
Construct an element.
Declaration
[JsonConstructor]
public Element(Guid id = default(Guid), string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The unique id of the element. |
System.String | name | The name of the element. |
Properties
AdditionalProperties
A collection of additional properties.
Declaration
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> |
Id
A unique id.
Declaration
[JsonProperty("Id", Required = Required.Always)]
[Required(AllowEmptyStrings = true)]
public Guid Id { get; set; }
Property Value
Type | Description |
---|---|
System.Guid |
Name
A name.
Declaration
[JsonProperty("Name", Required = Required.Default)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetMapping(String)
Retrieve a mapping for a given context.
Declaration
public MappingBase GetMapping(string context)
Parameters
Type | Name | Description |
---|---|---|
System.String | context | The context of the mapping being requested. |
Returns
Type | Description |
---|---|
MappingBase | The mapping if it exists, null if not. |
GetMapping<T>(String)
Retrieve a mapping for a given context.
Declaration
public T GetMapping<T>(string context)
where T : MappingBase
Parameters
Type | Name | Description |
---|---|---|
System.String | context | The context of the mapping being requested. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | The Type of mapping expected. |
RaisePropertyChanged(String)
Raise a property change event.
Declaration
protected virtual void RaisePropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The name of the property. |
SetMapping(String, MappingBase)
The method used to set a mapping for a given context.
Declaration
public void SetMapping(string context, MappingBase mapping)
Parameters
Type | Name | Description |
---|---|---|
System.String | context | |
MappingBase | mapping |
Events
PropertyChanged
An event raised when a property is changed.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |
Implements
System.ComponentModel.INotifyPropertyChanged