Class PropertyAccess
Property Access to Objects using Reflection.
Inheritance
Implements
Namespace: DotNetNuke.Services.Tokens
Assembly: DotNetNuke.dll
Syntax
public class PropertyAccess : object, IPropertyAccess
Constructors
| Improve this Doc View SourcePropertyAccess(Object)
Initializes a new instance of the PropertyAccess class.
Declaration
public PropertyAccess(object tokenSource)
Parameters
Type | Name | Description |
---|---|---|
System.Object | tokenSource |
Properties
| Improve this Doc View SourceCacheability
Gets the cache level for property access.
Declaration
public CacheLevel Cacheability { get; }
Property Value
Type | Description |
---|---|
CacheLevel |
ContentLocked
Property Access to Objects using Reflection.
Declaration
public static string ContentLocked { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceBoolean2LocalizedYesNo(Boolean, CultureInfo)
Boolean2LocalizedYesNo returns the translated string for "yes" or "no" against a given boolean value.
Declaration
public static string Boolean2LocalizedYesNo(bool value, CultureInfo formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value to localize. |
CultureInfo | formatProvider | The culture info. |
Returns
Type | Description |
---|---|
System.String |
|
FormatString(String, String)
Returns a formatted String if a format is given, otherwise it returns the unchanged value.
Declaration
public static string FormatString(string value, string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | string to be formatted. |
System.String | format | format specification. |
Returns
Type | Description |
---|---|
System.String | formatted string. |
GetObjectProperty(Object, String, String, CultureInfo, ref Boolean)
Returns the localized property of any object as string using reflection.
Declaration
public static string GetObjectProperty(object objObject, string strPropertyName, string strFormat, CultureInfo formatProvider, ref bool propertyNotFound)
Parameters
Type | Name | Description |
---|---|---|
System.Object | objObject | Object to access. |
System.String | strPropertyName | Name of property. |
System.String | strFormat | Format String. |
CultureInfo | formatProvider | specify formatting. |
System.Boolean | propertyNotFound | out: specifies, whether property was found. |
Returns
Type | Description |
---|---|
System.String | Localized Property. |
GetProperty(String, String, CultureInfo, UserInfo, Scope, ref Boolean)
Gets a property.
Declaration
public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope accessLevel, ref bool propertyNotFound)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The property name to get. |
System.String | format | The format string to format the property with, or |
CultureInfo | formatProvider | The format provider (e.g. |
UserInfo | accessingUser | The user this property belongs to, UserInfo. |
Scope | accessLevel | The Scope of the access level for this property. |
System.Boolean | propertyNotFound | An out parameter that indicates if the property was not found. |
Returns
Type | Description |
---|---|
System.String | A string with the value of the property. |