In The Hand - .NET Components for Mobility
PimItemCollection Class
NamespacesInTheHand.WindowsMobile.PocketOutlookPimItemCollection
Allows you to add new items or retrieve existing items from the store.
Declaration Syntax
C#Visual Basic
public class PimItemCollection : IDisposable, 
	IBindingList, IList, ICollection, IEnumerable
Public Class PimItemCollection _
	Implements IDisposable, IBindingList, IList, ICollection,  _
	IEnumerable
Members
All MembersMethodsPropertiesEvents



IconMemberDescription
Add(PimItem)
Creates and inserts a new PIM item into the collection.

AddNew()()()
Adds a new PIM item to the collection

AllowEdit
Gets a value indicating whether it is possible to update PIM items in the collection.

AllowNew
Gets a value indicating whether it is possible to use AddNew to add PIM items to the collection.

AllowRemove
Gets a value indicating whether it is possible to use either Remove or RemoveAt to remove PIM items from the collection.

ApplySort(PropertyDescriptor, ListSortDirection)
Sorts the list based on a property descriptor and a sort direction.

Clear()()()
Deletes all PIM items from the collection.

Contains(Object)
Gets a value indicating whether the collection contains the supplied PIM item.

Contains(PimItem)
Gets a value indicating whether a specific PIM item exists in the collection.

CopyTo(array<PimItem>[]()[], Int32)
Copies all PIM items in the collection into a PimItem array, beginning at the specified array index.

Count
Returns the number of items in the collection.

Dispose()()()
Releases all resources used by the PimItemCollection.

Dispose(Boolean)

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()
Frees the resources of the current PimItemCollection object before it is reclaimed by the garbage collector.
(Overrides Object.Finalize()()().)
Find(String)
Finds the first PimItem in the collection that passes the given restriction.

Find(PropertyDescriptor, Object)
Finds the PimItem with the matching property description value.

FindNext()()()
This method finds the next PimItem in a collection that passes the restriction specified by the most recent call to Find(String).

GetHashCode()()()
Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
IndexOf(PimItem)
Gets a PIM item’s position in the collection.

Insert(Int32, PimItem)
Not Implemented, use AddNew()()() to add new items.

IsFixedSize
Gets a value indicating whether the collection has a fixed size.

IsSorted
Gets a value indicating whether the items in the collection are sorted.

Item[([(Int32])])
Retrieves an item from a folder, based on the current sort order.

ItemAdded
Occurs when a new item is added.

ItemChanged
Occurs when an item was modified.

ItemDeleted
Occurs when an item was deleted from the collection. The item itself cannot be read at this point but the EventArgs contains the ItemId of the affected item.

ListChanged
Occurs when the list changes.

MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Remove(PimItem)
Removes a PimItem from the collection.

RemoveAt(Int32)
Remove the PimItem at the specified index.

RemoveIndex(PropertyDescriptor)
Removes the property descriptor from the search indexes.

RemoveSort()()()
Removes a sort applied with ApplySort.

Restrict(String)
Returns a new PimItemCollection that contains only items that pass a specified restriction.

Sort(String, Boolean)
Sort items in a collection on a given property.

Sort(String)
Sort items in a collection on a given property.

SortDirection
Gets the direction of the sort.

SortProperty
Gets the sorting property descriptor.

SupportsChangeNotification
Gets a value indicating whether a ListChanged event is raised when either the list changes, or a PIM item in the list changes.

SupportsSearching
Gets a value indicating whether the collection supports searching using the Find method.

SupportsSorting
Gets a value indicating whether the collection supports sorting (that is, whether it is possible to use the Sort(String, Boolean) and ApplySort(PropertyDescriptor, ListSortDirection) methods).

ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Remarks
Using this object, you can also perform basic filters that will allow you to more easily access PIM data. Note that when you first retrieve an items collection from a folder, it will have a default sort order as described below, and will be sorted in ascending order. If you get an Items collection from the Restrict(String) method, it will inherit the sort order from its parent.
Examples
The following example demonstrates how to bind an item collection to a DataGrid control.
CopyC#
[VB]
            Imports InTheHand.WindowsMobile.PocketOutlook

            'create a new application object
            Dim myapp As New OutlookSession

            'bind the datagrid source
            dataGrid1.Datasource = myapp.Contacts.Items

            'dispose of COM objects
            myapp.Contacts.Items.Dispose
            myapp.Contacts.Dispose
            myapp.Dispose
CopyC#
[C#]
            using InTheHand.WindowsMobile.PocketOutlook;

            //create a new application object
            OutlookSession myapp = new OutlookSession();

            //bind the grid to the contacts list
            dataGrid1.DataSource = myapp.Contacts.Items;

            //dispose all COM items
            myapp.Contacts.Items.Dispose();
            myapp.Contacts.Dispose();
            myapp.Dispose();
Inheritance Hierarchy

Assembly: InTheHand.WindowsMobile (Module: InTheHand.WindowsMobile) Version: 3.2.0.0