Class PropertyBoolean

Property representing a Boolean value.

Inheritance
System.Object
PropertyBoolean
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class PropertyBoolean : PropertyData, IReadOnly<PropertyData>, IReadOnly
Remarks

This class will render a check box when put in Edit mode using the EPiServer.Web.WebControls.Property Web control.

A boolean value of false will always be handled as a null value so there is a difference between a value that hasn't been set and a value that has been set to false. Default value is false(null).

Constructors

PropertyBoolean()

Initializes a new instance of the PropertyBoolean class.

Declaration
public PropertyBoolean()

PropertyBoolean(Boolean)

Initializes a new instance of the PropertyBoolean class.

Declaration
public PropertyBoolean(bool boolValue)
Parameters
Type Name Description
System.Boolean boolValue

The initial value of the property.

Properties

Boolean

Gets or sets the actual value for this property as a System.Boolean.

Declaration
public virtual bool Boolean { get; set; }
Property Value
Type Description
System.Boolean

The actual value for this property as a System.Boolean.

PropertyValueType

Gets the System.Type of the property value.

Declaration
public override Type PropertyValueType { get; }
Property Value
Type Description
System.Type

The System.Type of the property value.

Overrides

Type

Property type as defined by enum PropertyDataType.

Declaration
public override PropertyDataType Type { get; }
Property Value
Type Description
PropertyDataType

The type as defined by enum PropertyDataType.

Overrides

Value

Gets or sets the value of the property.

Declaration
public override object Value { get; set; }
Property Value
Type Description
System.Object

The value of the property.

Overrides
Remarks

Value returns null if the property has no value defined.

Methods

CreatePropertyControl()

Creates a PropertyBooleanControl that is used to display a user interface for the property.

Declaration
public override IPropertyControl CreatePropertyControl()
Returns
Type Description
IPropertyControl

A PropertyBooleanControl that is used to display a user interface for the property.

Overrides
Remarks

It is possible to change which control should be used by registering a different IPropertyControl for the PropertyData class in PropertyControlClassFactory.

Parse(String)

Creates a new instance of PropertyBoolean with the given value, ie reversed ToString().

Declaration
public static PropertyBoolean Parse(string value)
Parameters
Type Name Description
System.String value

The string value to parse.

Returns
Type Description
PropertyBoolean

A a new instance of PropertyBoolean with the given value.

Remarks

Throws a InvalidPropertyValueException if the value can not be parsed as a System.Boolean.

ParseToObject(String)

Creates a new instance of PropertyBoolean with the given value, ie reversed ToString().

Declaration
public override PropertyData ParseToObject(string value)
Parameters
Type Name Description
System.String value

The string value to parse.

Returns
Type Description
PropertyData

A new instance of PropertyBoolean with the given value.

Overrides

ParseToSelf(String)

Sets the value of the property from a string representation.

Declaration
public override void ParseToSelf(string value)
Parameters
Type Name Description
System.String value

The string value to parse.

Overrides

SetDefaultValue()

Sets the default value for this property.

Declaration
protected override void SetDefaultValue()
Overrides

Implements

Extension Methods