Class Task
- Namespace
- Microsoft.Exchange.WebServices.Data
- Assembly
- Microsoft.Exchange.WebServices.dll
Represents a Task item. Properties available on tasks are defined in the TaskSchema class.
public class Task : Item
- Inheritance
-
Task
- Inherited Members
Constructors
Task(ExchangeService)
Initializes an unsaved local instance of Task. To bind to an existing task, use Task.Bind() instead.
public Task(ExchangeService service)
Parameters
service
ExchangeServiceThe ExchangeService instance to which this task is bound.
Properties
ActualWork
Gets or sets the actual amount of time that is spent on the task.
public int? ActualWork { get; set; }
Property Value
- int?
AssignedTime
Gets the date and time the task was assigned.
public DateTime? AssignedTime { get; }
Property Value
BillingInformation
Gets or sets the billing information of the task.
public string BillingInformation { get; set; }
Property Value
ChangeCount
Gets the number of times the task has changed since it was created.
public int ChangeCount { get; }
Property Value
Companies
Gets or sets a list of companies associated with the task.
public StringList Companies { get; set; }
Property Value
CompleteDate
Gets or sets the date and time on which the task was completed.
public DateTime? CompleteDate { get; set; }
Property Value
Contacts
Gets or sets a list of contacts associated with the task.
public StringList Contacts { get; set; }
Property Value
DelegationState
Gets the current delegation state of the task.
public TaskDelegationState DelegationState { get; }
Property Value
Delegator
Gets the name of the delegator of this task.
public string Delegator { get; }
Property Value
DueDate
Gets or sets the date and time on which the task is due.
public DateTime? DueDate { get; set; }
Property Value
IsComplete
Gets a value indicating whether the task is complete.
public bool IsComplete { get; }
Property Value
IsRecurring
Gets a value indicating whether the task is recurring.
public bool IsRecurring { get; }
Property Value
IsTeamTask
Gets a value indicating whether the task is a team task.
public bool IsTeamTask { get; }
Property Value
Mileage
Gets or sets the mileage of the task.
public string Mileage { get; set; }
Property Value
Mode
Gets a value indicating the mode of the task.
public TaskMode Mode { get; }
Property Value
Owner
Gets the name of the owner of the task.
public string Owner { get; }
Property Value
PercentComplete
Gets or sets the completeion percentage of the task. PercentComplete must be between 0 and 100.
public double PercentComplete { get; set; }
Property Value
Recurrence
Gets or sets the recurrence pattern for this task. Available recurrence pattern classes include Recurrence.DailyPattern, Recurrence.MonthlyPattern and Recurrence.YearlyPattern.
public Recurrence Recurrence { get; set; }
Property Value
StartDate
Gets or sets the date and time on which the task starts.
public DateTime? StartDate { get; set; }
Property Value
Status
Gets or sets the status of the task.
public TaskStatus Status { get; set; }
Property Value
StatusDescription
Gets a string representing the status of the task, localized according to the PreferredCulture property of the ExchangeService object the task is bound to.
public string StatusDescription { get; }
Property Value
TotalWork
Gets or sets the total amount of work spent on the task.
public int? TotalWork { get; set; }
Property Value
- int?
Methods
Bind(ExchangeService, ItemId)
Binds to an existing task and loads its first class properties. Calling this method results in a call to EWS.
public static Task Bind(ExchangeService service, ItemId id)
Parameters
service
ExchangeServiceThe service to use to bind to the task.
id
ItemIdThe Id of the task to bind to.
Returns
- Task
A Task instance representing the task corresponding to the specified Id.
Bind(ExchangeService, ItemId, PropertySet)
Binds to an existing task and loads the specified set of properties. Calling this method results in a call to EWS.
public static Task Bind(ExchangeService service, ItemId id, PropertySet propertySet)
Parameters
service
ExchangeServiceThe service to use to bind to the task.
id
ItemIdThe Id of the task to bind to.
propertySet
PropertySetThe set of properties to load.
Returns
- Task
A Task instance representing the task corresponding to the specified Id.
DeleteCurrentOccurrence(DeleteMode)
Deletes the current occurrence of a recurring task. After the current occurrence isdeleted, the task represents the next occurrence. Developers should call Load to retrieve the new property values of the task. Calling this method results in a call to EWS.
public void DeleteCurrentOccurrence(DeleteMode deleteMode)
Parameters
deleteMode
DeleteModeThe deletion mode.
Update(ConflictResolutionMode)
Applies the local changes that have been made to this task. Calling this method results in at least one call to EWS. Mutliple calls to EWS might be made if attachments have been added or removed.
public Task Update(ConflictResolutionMode conflictResolutionMode)
Parameters
conflictResolutionMode
ConflictResolutionModeSpecifies how conflicts should be resolved.
Returns
- Task
A Task object representing the completed occurrence if the task is recurring and the update marks it as completed; or a Task object representing the current occurrence if the task is recurring and the uypdate changed its recurrence pattern; or null in every other case.