C++ C#

ItemObject Class

API Reference

Namespace: Semata.DataStore.ObjectModel

A wrapper for an Item. Classes generated for Items inherit from this class. The classes will have a property for each of their Attributes and Associations. These properties return a class that wraps the Attribute or Association. Changes to attributes are cached until the Write method is invoked.

public abstract class ItemObject : INotifyPropertyChangedAndWritten, INotifyDataErrorInfo, IEquatable<ItemObject>

Implements: INotifyPropertyChangedAndWritten , INotifyDataErrorInfo , IEquatable<ItemObject>

Constructors

Name Description
ItemObject(ItemObjectInitializer)

Constructs an instance of ItemObject

Events

Name Description
ErrorsChanged

Occurs when the validation errors have changed for a property or for the entire object

PropertyChanged

Occurs when a changed property value is changed

PropertyWritten

Occurs when a changed property value is written

Properties

Name Description
DataStore

Returns the DataStore object

EventDispatcher

Returns the EventDispatcher used by the DataStore

HasErrors

Gets a value that indicates whether the object has validation errors.

IsChanged

Are there any changes to properties that have not been written to the DataStore?

IsDeleted

Has this Item been deleted?

IsNew

Is the data new? In other words, has been written to the DataStore.

ItemType

The ItemType of this ItemObject

Methods

Name Description
AddError(string, string)

Adds a validation error for a specified property or for the entire object.

CanDelete()

Checks that a delete will succeed

CancelEdit()

Cancel changes to properties that have not been written to DataStore

ClearErrors()

Clears the validation errors for all specified properties and the entire entity.

ClearErrors(string)

Clears the validation errors for a specified property or for the entire object.

Delete()

Delete the Item from the DataStore

Equals(ItemObject)

returns true if ItemObjects are the same

GetErrors()

Gets the validation errors for all specified properties and the entire entity.

GetErrors(string)

Gets the validation errors for a specified property or for the entire object.

GetItemId()

Returns the ItemID of this object

NotifyErrorsChanged(DataErrorsChangedEventArgs)

Raises event ErrorsChanged

NotifyPropertyChanged(PropertyChangedEventArgs)

Raises event PropertyChanged

NotifyPropertyWritten(PropertyChangedEventArgs)

Raises event PropertyWritten

OnItemObjectCanDelete()

Called by Delete prior to deleting item. Deletion will be be prevented if result has errors

OnItemObjectCreated()

Called by Write when a new item is created.

OnItemObjectDeleting()

Called by Delete prior to deleting item. Main difference to above that this is called inside transaction that deletes item.

OnItemObjectValidate()

Called by Validate (which is also called by Write)

OnItemObjectWriting()

Called by Write before all the changed properties are set.

OnItemObjectWritten()

Called by Write after all the changed properties are set.

QueuePropertyWritten(PropertyChangedEventArgs)

Queue a property written event to be fired after transactions ends

Validate()

Validate the Item

Write()

If it is a new Item create the Item, and write any changed properties to the DataStore.

This website stores cookies on your computer that are used to manage the order in which you see the pages. To find out more about the cookies we use, see our Privacy Policy.