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
service
ExchangeServiceEWS 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
service
ExchangeServiceThe service to use to bind to the folder.
id
FolderIdThe 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
service
ExchangeServiceThe service to use to bind to the folder.
id
FolderIdThe Id of the folder to bind to.
propertySet
PropertySetThe 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
service
ExchangeServiceThe service to use to bind to the folder.
name
WellKnownFolderNameThe 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
service
ExchangeServiceThe service to use to bind to the folder.
name
WellKnownFolderNameThe name of the folder to bind to.
propertySet
PropertySetThe 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
destinationFolderId
FolderIdThe 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
destinationFolderName
WellKnownFolderNameThe 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
deleteMode
DeleteModeDeletion mode.
Empty(DeleteMode, bool)
Empties the folder. Calling this method results in a call to EWS.
public void Empty(DeleteMode deleteMode, bool deleteSubFolders)
Parameters
deleteMode
DeleteModeThe deletion mode.
deleteSubFolders
boolIndicates 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
view
FolderViewThe 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
searchFilter
SearchFilterThe search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection
view
FolderViewThe 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
view
ItemViewThe 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
view
ItemViewThe view controlling the number of items returned.
groupBy
GroupingThe 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
searchFilter
SearchFilterThe search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection
view
ItemViewThe 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
searchFilter
SearchFilterThe search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection
view
ItemViewThe view controlling the number of items returned.
groupBy
GroupingThe 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
queryString
stringquery string to be used for indexed search
view
ItemViewThe 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
queryString
stringquery string to be used for indexed search
view
ItemViewThe view controlling the number of items returned.
groupBy
GroupingThe 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
suppressReadReceipts
boolIf 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
suppressReadReceipts
boolIf 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
destinationFolderId
FolderIdThe 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
destinationFolderName
WellKnownFolderNameThe 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
extendedPropertyDefinition
ExtendedPropertyDefinitionThe 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
parentFolderId
FolderIdThe 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
parentFolderName
WellKnownFolderNameThe 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
extendedPropertyDefinition
ExtendedPropertyDefinitionThe extended property definition.
value
objectThe 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()