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 ref class ItemObject abstract : public 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

ItemObjectWritten

Occurs once after any changed property values are written

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

deleteErrorMessages_

Checks that a delete will succeed

Methods

Name Description
AddError(String^, String^)

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

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

Delete(bool)

Delete the Item from the DataStore, and throw exception if errors occur and throwException is true <param name="throwException">if true errors will cause exception to be thrown.</param>

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

NotifyItemObjectWritten(EventArgs^)

Raises event ItemObjectWritten

NotifyPropertyChanged(PropertyChangedEventArgs^)

Raises event PropertyChanged

NotifyPropertyWritten(PropertyChangedEventArgs^)

Raises event PropertyWritten

OnItemObjectCanDelete(List<string>^)

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.

Write(bool)

Write Item and throw exception if errors occur <param name="throwException">if true errors will cause exception to be thrown.</param>

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.