Class DataItem
Class DataItem.
Inheritance
Implements
Inherited Members
Namespace: spyderSoft.DataLayer.Core
Assembly: spyderSoft.DataLayer.Core.dll
Syntax
[DataContract]
public abstract class DataItem : IDataItem
Properties
| Improve this Doc View SourceId
Gets or sets the identifier.
Declaration
[DataMember]
public abstract long Id { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 | The identifier. |
Methods
| Improve this Doc View SourceGetPropertyName<T>(Expression<Func<T>>)
Gets the name of the property.
Declaration
protected static string GetPropertyName<T>(Expression<Func<T>> propertyExpression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T>> | propertyExpression | The property expression. |
Returns
Type | Description |
---|---|
System.String | System.String. |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | propertyExpression |
System.ArgumentException | Invalid argument;propertyExpression or Argument is not a property;propertyExpression |
RaiseValueChanged(String)
Raises the ValueChanged event using the propertyName
given.
Declaration
protected virtual void RaiseValueChanged(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property. |
RaiseValueChanged<TPropertyReturnType>(Expression<Func<TPropertyReturnType>>)
Raises the ValueChanged event using the name from the given property expression.
Declaration
protected virtual void RaiseValueChanged<TPropertyReturnType>(Expression<Func<TPropertyReturnType>> propertyExpression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TPropertyReturnType>> | propertyExpression | An expression representing the property whose value has changed. |
Type Parameters
Name | Description |
---|---|
TPropertyReturnType | When using this method the PropertyReturnType specified must be the same as the type of the property that is changing |
SetPropertyField<T>(String, ref T, T)
Set the value of field
to newValue
if they are not equal, and then raise
the ValueChanged event using propertyName
Declaration
protected void SetPropertyField<T>(string propertyName, ref T field, T newValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The name of the property being changed. |
T | field | The current field value |
T | newValue | The desired field value |
Type Parameters
Name | Description |
---|---|
T | The type for |
Events
| Improve this Doc View SourceValueChanged
An event which is raised when the value of a property is updated
Declaration
public event EventHandler<DataItemEventArgs> ValueChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DataItemEventArgs> |