FieldMapping
Importing field description.
Inherits: NotifiableObject
Implements: IAsyncPersistable, ICloneable
Constructors
protected FieldMapping(string name, Func<string> getDisplayName, Func<string> getDescription, Type type)
fieldMapping = FieldMapping(name, getDisplayName, getDescription, type)
Initializes a new instance of the FieldMapping.
- name
- Name.
- getDisplayName
- Display name.
- getDescription
- Description.
- type
- Field type.
Properties
public Type AdapterType { get; set; }
value = fieldMapping.AdapterType
fieldMapping.AdapterType = value
Adapter.
public string DefaultValue { get; set; }
value = fieldMapping.DefaultValue
fieldMapping.DefaultValue = value
Default value.
public string Format { get; set; }
value = fieldMapping.Format
fieldMapping.Format = value
Date format.
public bool IsAdapter { get; set; }
value = fieldMapping.IsAdapter
fieldMapping.IsAdapter = value
AdapterType required.
public bool IsEnabled { get; set; }
value = fieldMapping.IsEnabled
fieldMapping.IsEnabled = value
Is field enabled.
public bool IsExtended { get; set; }
value = fieldMapping.IsExtended
fieldMapping.IsExtended = value
Is field extended.
public bool IsMultiple { get; }
value = fieldMapping.IsMultiple
Multiple field's instancies allowed.
public bool IsRequired { get; set; }
value = fieldMapping.IsRequired
fieldMapping.IsRequired = value
Is field required.
public string Name { get; private set; }
value = fieldMapping.Name
fieldMapping.Name = value
Name.
public int? Order { get; set; }
value = fieldMapping.Order
fieldMapping.Order = value
Field order.
public IEnumerable<FieldMappingValue> Values { get; set; }
value = fieldMapping.Values
fieldMapping.Values = value
Mapping values.
public bool ZeroAsNull { get; set; }
value = fieldMapping.ZeroAsNull
fieldMapping.ZeroAsNull = value
Zero as .
Methods
public void ApplyDefaultValue(object instance)
fieldMapping.ApplyDefaultValue(instance)
Apply default value.
- instance
- Instance.
public void ApplyFileValue(object instance, string value)
fieldMapping.ApplyFileValue(instance, value)
Apply value.
- instance
- Instance.
- value
- Field value.
public abstract object Clone()
result = fieldMapping.Clone()
Creates a new object that is a deep copy of the current instance.
Returns: A new object that is a deep copy of this instance.
protected void CopyTo(FieldMapping destination)
fieldMapping.CopyTo(destination)
Copy the settings into .
- destination
- The field that receives the settings.
public FieldMapping GetOrClone()
result = fieldMapping.GetOrClone()
Get FieldMapping instance or clone dependent on IsMultiple.
Returns: Field.
public Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = fieldMapping.LoadAsync(storage, cancellationToken)
Load settings.
- storage
- Settings storage.
- cancellationToken
- CancellationToken
Returns: Task
protected abstract void OnApply(object instance, object value)
fieldMapping.OnApply(instance, value)
Apply value.
- instance
- Instance.
- value
- Field value.
public override string ToString()
result = fieldMapping.ToString()
Returns a string representation of the tuple, with values separated by commas.
Returns: A string representing the tuple's values.
Fields
protected readonly Func<string> GetDescription
value = fieldMapping.GetDescription
Description.
protected readonly Func<string> GetDisplayName
value = fieldMapping.GetDisplayName
Display name.