Class Folder
- Namespace
- Microsoft.Exchange.WebServices.Data
- Assembly
- Microsoft.Exchange.WebServices.dll
Represents a generic folder.
public class Folder : ServiceObject
- Inheritance
-
Folder
- Derived
- Inherited Members
Constructors
Folder(ExchangeService)
Initializes an unsaved local instance of Folder. To bind to an existing folder, use Folder.Bind() instead.
public Folder(ExchangeService service)
Parameters
serviceExchangeServiceEWS service to which this object belongs.
Properties
ArchiveTag
Gets or sets the archive tag.
public ArchiveTag ArchiveTag { get; set; }
Property Value
ChildFolderCount
Gets the number of child folders this folder has.
public int ChildFolderCount { get; }
Property Value
DisplayName
Gets or sets the display name of the folder.
public string DisplayName { get; set; }
Property Value
EffectiveRights
Gets a value indicating the effective rights the current authenticated user has on the folder.
public EffectiveRights EffectiveRights { get; }
Property Value
ExtendedProperties
Gets a list of extended properties associated with the folder.
public ExtendedPropertyCollection ExtendedProperties { get; }
Property Value
FolderClass
Gets or sets the custom class name of this folder.
public string FolderClass { get; set; }
Property Value
Id
Gets the Id of the folder.
public FolderId Id { get; }
Property Value
ManagedFolderInformation
Gets the Email Lifecycle Management (ELC) information associated with the folder.
public ManagedFolderInformation ManagedFolderInformation { get; }
Property Value
ParentFolderId
Gets the Id of this folder's parent folder.
public FolderId ParentFolderId { get; }
Property Value
Permissions
Gets a list of permissions for the folder.
public FolderPermissionCollection Permissions { get; }
Property Value
PolicyTag
Gets or sets the policy tag.
public PolicyTag PolicyTag { get; set; }
Property Value
TotalCount
Gets the total number of items contained in the folder.
public int TotalCount { get; }
Property Value
UnreadCount
Gets the number of unread items in the folder.
public int UnreadCount { get; }
Property Value
WellKnownFolderName
Gets the name of the well known folder.
public WellKnownFolderName? WellKnownFolderName { get; }
Property Value
- WellKnownFolderName?
The name of the well known folder.
Methods
Bind(ExchangeService, FolderId)
Binds to an existing folder, whatever its actual type is, and loads its first class properties. Calling this method results in a call to EWS.
public static Folder Bind(ExchangeService service, FolderId id)
Parameters
serviceExchangeServiceThe service to use to bind to the folder.
idFolderIdThe Id of the folder to bind to.
Returns
- Folder
A Folder instance representing the folder corresponding to the specified Id.
Bind(ExchangeService, FolderId, PropertySet)
Binds to an existing folder, whatever its actual type is, and loads the specified set of properties. Calling this method results in a call to EWS.
public static Folder Bind(ExchangeService service, FolderId id, PropertySet propertySet)
Parameters
serviceExchangeServiceThe service to use to bind to the folder.
idFolderIdThe Id of the folder to bind to.
propertySetPropertySetThe set of properties to load.
Returns
- Folder
A Folder instance representing the folder corresponding to the specified Id.
Bind(ExchangeService, WellKnownFolderName)
Binds to an existing folder, whatever its actual type is, and loads its first class properties. Calling this method results in a call to EWS.
public static Folder Bind(ExchangeService service, WellKnownFolderName name)
Parameters
serviceExchangeServiceThe service to use to bind to the folder.
nameWellKnownFolderNameThe name of the folder to bind to.
Returns
- Folder
A Folder instance representing the folder with the specified name.
Bind(ExchangeService, WellKnownFolderName, PropertySet)
Binds to an existing folder, whatever its actual type is, and loads the specified set of properties. Calling this method results in a call to EWS.
public static Folder Bind(ExchangeService service, WellKnownFolderName name, PropertySet propertySet)
Parameters
serviceExchangeServiceThe service to use to bind to the folder.
nameWellKnownFolderNameThe name of the folder to bind to.
propertySetPropertySetThe set of properties to load.
Returns
- Folder
A Folder instance representing the folder with the specified name.
Copy(FolderId)
Copies this folder into a specific folder. Calling this method results in a call to EWS.
public Folder Copy(FolderId destinationFolderId)
Parameters
destinationFolderIdFolderIdThe Id of the folder in which to copy this folder.
Returns
- Folder
A Folder representing the copy of this folder.
Copy(WellKnownFolderName)
Copies this folder into the specified folder. Calling this method results in a call to EWS.
public Folder Copy(WellKnownFolderName destinationFolderName)
Parameters
destinationFolderNameWellKnownFolderNameThe name of the folder in which to copy this folder.
Returns
- Folder
A Folder representing the copy of this folder.
Delete(DeleteMode)
Deletes the folder. Calling this method results in a call to EWS.
public void Delete(DeleteMode deleteMode)
Parameters
deleteModeDeleteModeDeletion mode.
Empty(DeleteMode, bool)
Empties the folder. Calling this method results in a call to EWS.
public void Empty(DeleteMode deleteMode, bool deleteSubFolders)
Parameters
deleteModeDeleteModeThe deletion mode.
deleteSubFoldersboolIndicates whether sub-folders should also be deleted.
FindFolders(FolderView)
Obtains a list of folders by searching the sub-folders of this folder. Calling this method results in a call to EWS.
public FindFoldersResults FindFolders(FolderView view)
Parameters
viewFolderViewThe view controlling the number of folders returned.
Returns
- FindFoldersResults
An object representing the results of the search operation.
FindFolders(SearchFilter, FolderView)
Obtains a list of folders by searching the sub-folders of this folder. Calling this method results in a call to EWS.
public FindFoldersResults FindFolders(SearchFilter searchFilter, FolderView view)
Parameters
searchFilterSearchFilterThe search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection
viewFolderViewThe view controlling the number of folders returned.
Returns
- FindFoldersResults
An object representing the results of the search operation.
FindItems(ItemView)
Obtains a list of items by searching the contents of this folder. Calling this method results in a call to EWS.
public FindItemsResults<Item> FindItems(ItemView view)
Parameters
viewItemViewThe view controlling the number of items returned.
Returns
- FindItemsResults<Item>
An object representing the results of the search operation.
FindItems(ItemView, Grouping)
Obtains a grouped list of items by searching the contents of this folder. Calling this method results in a call to EWS.
public GroupedFindItemsResults<Item> FindItems(ItemView view, Grouping groupBy)
Parameters
viewItemViewThe view controlling the number of items returned.
groupByGroupingThe grouping criteria.
Returns
- GroupedFindItemsResults<Item>
A collection of grouped items representing the contents of this folder.
FindItems(SearchFilter, ItemView)
Obtains a list of items by searching the contents of this folder. Calling this method results in a call to EWS.
public FindItemsResults<Item> FindItems(SearchFilter searchFilter, ItemView view)
Parameters
searchFilterSearchFilterThe search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection
viewItemViewThe view controlling the number of items returned.
Returns
- FindItemsResults<Item>
An object representing the results of the search operation.
FindItems(SearchFilter, ItemView, Grouping)
Obtains a grouped list of items by searching the contents of this folder. Calling this method results in a call to EWS.
public GroupedFindItemsResults<Item> FindItems(SearchFilter searchFilter, ItemView view, Grouping groupBy)
Parameters
searchFilterSearchFilterThe search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection
viewItemViewThe view controlling the number of items returned.
groupByGroupingThe grouping criteria.
Returns
- GroupedFindItemsResults<Item>
A collection of grouped items representing the contents of this folder.
FindItems(string, ItemView)
Obtains a list of items by searching the contents of this folder. Calling this method results in a call to EWS.
public FindItemsResults<Item> FindItems(string queryString, ItemView view)
Parameters
queryStringstringquery string to be used for indexed search
viewItemViewThe view controlling the number of items returned.
Returns
- FindItemsResults<Item>
An object representing the results of the search operation.
FindItems(string, ItemView, Grouping)
Obtains a grouped list of items by searching the contents of this folder. Calling this method results in a call to EWS.
public GroupedFindItemsResults<Item> FindItems(string queryString, ItemView view, Grouping groupBy)
Parameters
queryStringstringquery string to be used for indexed search
viewItemViewThe view controlling the number of items returned.
groupByGroupingThe grouping criteria.
Returns
- GroupedFindItemsResults<Item>
A collection of grouped items representing the contents of this folder.
MarkAllItemsAsRead(bool)
Marks all items in folder as read. Calling this method results in a call to EWS.
public void MarkAllItemsAsRead(bool suppressReadReceipts)
Parameters
suppressReadReceiptsboolIf true, suppress sending read receipts for items.
MarkAllItemsAsUnread(bool)
Marks all items in folder as read. Calling this method results in a call to EWS.
public void MarkAllItemsAsUnread(bool suppressReadReceipts)
Parameters
suppressReadReceiptsboolIf true, suppress sending read receipts for items.
Move(FolderId)
Moves this folder to a specific folder. Calling this method results in a call to EWS.
public Folder Move(FolderId destinationFolderId)
Parameters
destinationFolderIdFolderIdThe Id of the folder in which to move this folder.
Returns
- Folder
A new folder representing this folder in its new location. After Move completes, this folder does not exist anymore.
Move(WellKnownFolderName)
Moves this folder to the specified folder. Calling this method results in a call to EWS.
public Folder Move(WellKnownFolderName destinationFolderName)
Parameters
destinationFolderNameWellKnownFolderNameThe name of the folder in which to move this folder.
Returns
- Folder
A new folder representing this folder in its new location. After Move completes, this folder does not exist anymore.
RemoveExtendedProperty(ExtendedPropertyDefinition)
Removes an extended property.
public bool RemoveExtendedProperty(ExtendedPropertyDefinition extendedPropertyDefinition)
Parameters
extendedPropertyDefinitionExtendedPropertyDefinitionThe extended property definition.
Returns
- bool
True if property was removed.
Save(FolderId)
Saves this folder in a specific folder. Calling this method results in a call to EWS.
public void Save(FolderId parentFolderId)
Parameters
parentFolderIdFolderIdThe Id of the folder in which to save this folder.
Save(WellKnownFolderName)
Saves this folder in a specific folder. Calling this method results in a call to EWS.
public void Save(WellKnownFolderName parentFolderName)
Parameters
parentFolderNameWellKnownFolderNameThe name of the folder in which to save this folder.
SetExtendedProperty(ExtendedPropertyDefinition, object)
Sets the extended property.
public void SetExtendedProperty(ExtendedPropertyDefinition extendedPropertyDefinition, object value)
Parameters
extendedPropertyDefinitionExtendedPropertyDefinitionThe extended property definition.
valueobjectThe value.
Update()
Applies the local changes that have been made to this folder. Calling this method results in a call to EWS.
public void Update()