Interface IFinContactFolder
Provides an abstract interface for storing a collection of FinContact instances.
public interface IFinContactFolder : IEnumerable
- Inherited Members
Remarks
The FinContact class provides the capability of storing itself through any IFinContactFolder implementation which may be provided by the application. Thus an application can completely control the storage of contact data. For simple applications a default implementation FinContactFolder is provided that stores the contacts as individual XML files in the file system.
The content of a IFinContactFolder must be enumerable. However there is no guarantee that every enumeration returns the contacts in the same order.
An implementation of IFinContactFolder must use the various persistency methods of the FinContact class in order to serialise and deserialise the object data for storage. No assumptions about the serialised data must be made.
Methods
Add(FinContact)
Stores the given FinContact in this folder.
void Add(FinContact aContact)
Parameters
aContactFinContact
Remarks
This method needs not and shall not check for duplicates. Even if all contact attributes are equal to another contact already stored in this folder, this method will store another equal copy. If, however, the given FinContact instance is identical (same object reference) to a previously added instance or a previously enumerated instance, then an exception is thrown.
Exceptions
- ArgumentNullException
The parameter
aContactwasnull.- InvalidOperationException
The very same FinContact instance was already added to this folder.
Remove(FinContact)
Deletes the given FinContact which is stored in this folder.
void Remove(FinContact aContact)
Parameters
aContactFinContactFinContact instance that has previously been added through Add(FinContact) or that was returned through enumeration of the folder contents.
Exceptions
- ArgumentNullException
The parameter
aContactwasnull.- InvalidOperationException
The given FinContact instance does not originate from this folder, or was already removed.
Update(FinContact)
Updates the stored data of the given FinContact.
void Update(FinContact aContact)
Parameters
aContactFinContactFinContact instance that has previously been added through Add(FinContact) or that was returned through enumeration of the folder contents.
Exceptions
- ArgumentNullException
The parameter
aContactwasnull.- InvalidOperationException
The given FinContact instance does not originate from this folder.