Class PropertyPointer
Inheritance
PropertyPointer
Assembly: NanoByte.Common.dll
Syntax
public static class PropertyPointer : Object
Methods
For<T>(Func<T>, Action<T>, T, Boolean)
Creates a property pointer.
Declaration
public static PropertyPointer<T> For<T>(Func<T> getValue, Action<T> setValue, T defaultValue, bool needsEncoding = false)
Parameters
Type |
Name |
Description |
Func<T> |
getValue |
A delegate that returns the current value.
|
Action<T> |
setValue |
A delegate that sets the value.
|
T |
defaultValue |
The default value of the property.
|
Boolean |
needsEncoding |
Indicates that this property needs to be encoded (e.g. as base64) before it can be stored in a file.
|
Returns
Type Parameters
Name |
Description |
T |
The type of value the property contains.
|
For<T>(Func<T>, Action<T>, Boolean)
Creates a property pointer.
Declaration
public static PropertyPointer<T> For<T>(Func<T> getValue, Action<T> setValue, bool needsEncoding = false)
where T : class
Parameters
Type |
Name |
Description |
Func<T> |
getValue |
A delegate that returns the current value.
|
Action<T> |
setValue |
A delegate that sets the value.
|
Boolean |
needsEncoding |
Indicates that this property needs to be encoded (e.g. as base64) before it can be stored in a file.
|
Returns
Type Parameters
Name |
Description |
T |
The type of value the property contains.
|
For<T>(Expression<Func<T>>, T, Boolean)
Creates a property pointer.
Declaration
public static PropertyPointer<T> For<T>(Expression<Func<T>> getValue, T defaultValue, bool needsEncoding = false)
Parameters
Type |
Name |
Description |
Expression<Func<T>> |
getValue |
An expression pointing to the property.
|
T |
defaultValue |
The default value of the property.
|
Boolean |
needsEncoding |
Indicates that this property needs to be encoded (e.g. as base64) before it can be stored in a file.
|
Returns
Type Parameters
Name |
Description |
T |
The type of value the property contains.
|
For<T>(Expression<Func<T>>, Boolean)
Creates a property pointer.
Declaration
public static PropertyPointer<T> For<T>(Expression<Func<T>> getValue, bool needsEncoding = false)
where T : class
Parameters
Type |
Name |
Description |
Expression<Func<T>> |
getValue |
An expression pointing to the property.
|
Boolean |
needsEncoding |
Indicates that this property needs to be encoded (e.g. as base64) before it can be stored in a file.
|
Returns
Type Parameters
Name |
Description |
T |
The type of value the property contains.
|
ToStringPointer(PropertyPointer<Boolean>)
Declaration
public static PropertyPointer<string> ToStringPointer(this PropertyPointer<bool> pointer)
Parameters
Returns
ToStringPointer(PropertyPointer<Int32>)
Declaration
public static PropertyPointer<string> ToStringPointer(this PropertyPointer<int> pointer)
Parameters
Returns
ToStringPointer(PropertyPointer<Int64>)
Declaration
public static PropertyPointer<string> ToStringPointer(this PropertyPointer<long> pointer)
Parameters
Returns
ToStringPointer(PropertyPointer<TimeSpan>)
Declaration
public static PropertyPointer<string> ToStringPointer(this PropertyPointer<TimeSpan> pointer)
Parameters
Returns
ToStringPointer(PropertyPointer<Uri>)
Wraps an Uri pointer in a String pointer. Maps empty strings to null
URIs.
Declaration
public static PropertyPointer<string> ToStringPointer(this PropertyPointer<Uri> pointer)
Parameters
Returns