Base interface and classes for creating value providers

Current version: 9.2

When you create a value provider, you must create a class that inherits the IFieldValueProvider interface. This interface contains the GetValue method that you must implement in your new class.

Interface or method

Description

Interface for providing field values

RequestResponse
public interface IFieldValueProvider
{FieldValueProviderContext ValueProviderContext { get; set; }

object GetValue(string parameters);
 }

Context for executing value providers

RequestResponse
public class FieldValueProviderContext
{
 public Database Database { get; set; }
 public Item FieldItem { get; set; }
 }

Method in the IValueField interface for field value initialization

RequestResponse
public interface IValueField
 {
 
 void InitializeValue(FieldValueProviderContext context);
 }

Virtual method in InputViewModel<TValueType> which is overridden in derived classes and casts the value supplied by the provider to the specified TValueType

RequestResponse
public class InputViewModel<TValueType>
 {

 protected virtual void InitializeValue(object value)
 {
 if (value != null)
 {
 Value = (TValueType)value;
 }
 }
 }

Do you have some feedback for us?

If you have suggestions for improving this article,