C# Class Felinesoft.UmbracoCodeFirst.DataTypes.SingleSelectDataType

A base class for data types which select a single value from a list of prevalues
This works with editors which store the actual string value as the property value. Editors which store the prevalue ID are not supported and in this case one should override Serialise and Initialise in a derived class to get the actual value based on the ID.
Inheritance: SelectListDataType
Show file Open project: DanMannMann/UmbracoCodeFirst

Public Methods

Method Description
Initialise ( string value ) : void

Initialises the current instance from a string containing a single value

Serialise ( ) : string

Serialises the current instance to a string containing the selected value

ToString ( ) : string

Protected Methods

Method Description
SetInvalidValue ( string value ) : void

Allows an invalid value to be explicitly set, bypassing the protection in the SelectedValue property setter.

This is equivalent to calling the base implementation of Initialise but, as Initialise is virtual, this method should be preferred as it guarantees the correct behaviour in derived types

Method Details

Initialise() public method

Initialises the current instance from a string containing a single value
public Initialise ( string value ) : void
value string The serialised value
return void

Serialise() public method

Serialises the current instance to a string containing the selected value
public Serialise ( ) : string
return string

SetInvalidValue() protected method

Allows an invalid value to be explicitly set, bypassing the protection in the SelectedValue property setter.
This is equivalent to calling the base implementation of Initialise but, as Initialise is virtual, this method should be preferred as it guarantees the correct behaviour in derived types
protected SetInvalidValue ( string value ) : void
value string The value to set
return void

ToString() public method

public ToString ( ) : string
return string