Class PropertySettingsAttribute
Attibute to specify a settings object for Properties and PropertyControls.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Core.PropertySettings
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[AttributeUsage(AttributeTargets.Class)]
public sealed class PropertySettingsAttribute : Attribute, _Attribute
Remarks
Use this attibute to specify properties or property controls that need to store settings on the page definition level.
Examples
Simple example of marking a property control with a settings attibute:
You can then use it together with a PropertySettingsUIAttribute:
Constructors
PropertySettingsAttribute(Type)
Initializes a new instance of the PropertySettingsAttribute class.
Declaration
public PropertySettingsAttribute(Type settingsType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | settingsType | Type of settings entity to use. |
PropertySettingsAttribute(Type, Boolean)
Initializes a new instance of the PropertySettingsAttribute class.
Declaration
public PropertySettingsAttribute(Type settingsType, bool useGlobals)
Parameters
Type | Name | Description |
---|---|---|
System.Type | settingsType | Type of settings entity to use. |
System.Boolean | useGlobals | if set to |
Properties
SettingsType
Gets or sets the type of settings entity.
Declaration
public Type SettingsType { get; set; }
Property Value
Type | Description |
---|---|
System.Type | The type of the settings. |
UseGlobals
Gets or sets a value indicating whether to enable multiple global settings to choose from in the admin UI.
Declaration
public bool UseGlobals { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
TryGetAttribute(Type, out PropertySettingsAttribute)
Tries to get a PropertySettingsAttribute from a type.
Declaration
public static bool TryGetAttribute(Type type, out PropertySettingsAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type. |
PropertySettingsAttribute | attribute | The attribute to set if succesfull. |
Returns
Type | Description |
---|---|
System.Boolean |
|