Class PropertyNumber
Property representing a numeric value.
Inheritance
Inherited Members
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 10.10.4Syntax
public class PropertyNumber : PropertyData, IReadOnly<PropertyData>, IReadOnlyConstructors
PropertyNumber()
Initializes a new instance of the PropertyNumber class.
Declaration
public PropertyNumber()PropertyNumber(Int32)
Initializes a new instance of the PropertyNumber class.
Declaration
public PropertyNumber(int numberValue)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | numberValue | The number value. | 
Properties
Number
Gets or sets the value of the property as an System.Int32.
Declaration
public int? Number { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Nullable<System.Int32> | The value of the property as an System.Int32. | 
PropertyValueType
Gets the System.Type of the property value.
Declaration
public override Type PropertyValueType { get; }Property Value
| Type | Description | 
|---|---|
| System.Type | The type of the property value. | 
Overrides
Type
Gets the property type as defined by enum PropertyDataType.
Declaration
public override PropertyDataType Type { get; }Property Value
| Type | Description | 
|---|---|
| PropertyDataType | The PropertyDataType 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 PropertyNumberControl that is used to display a user interface for the property.
Declaration
[Obsolete("Use IPropertyControlFactory to create property controls")]
public override IPropertyControl CreatePropertyControl()Returns
| Type | Description | 
|---|---|
| IPropertyControl | A PropertyNumberControl 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)
Parses the specified string.
Declaration
public static PropertyNumber Parse(string str)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | str | The string to parse. | 
Returns
| Type | Description | 
|---|---|
| PropertyNumber | A new instance of PropertyNumber with the value of the string parameter. | 
ParseToObject(String)
Creates a new instance of PropertyNumber 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 PropertyNumber 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()