Table of Contents

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 ExchangeService

The 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

DateTime?

BillingInformation

Gets or sets the billing information of the task.

public string BillingInformation { get; set; }

Property Value

string

ChangeCount

Gets the number of times the task has changed since it was created.

public int ChangeCount { get; }

Property Value

int

Companies

Gets or sets a list of companies associated with the task.

public StringList Companies { get; set; }

Property Value

StringList

CompleteDate

Gets or sets the date and time on which the task was completed.

public DateTime? CompleteDate { get; set; }

Property Value

DateTime?

Contacts

Gets or sets a list of contacts associated with the task.

public StringList Contacts { get; set; }

Property Value

StringList

DelegationState

Gets the current delegation state of the task.

public TaskDelegationState DelegationState { get; }

Property Value

TaskDelegationState

Delegator

Gets the name of the delegator of this task.

public string Delegator { get; }

Property Value

string

DueDate

Gets or sets the date and time on which the task is due.

public DateTime? DueDate { get; set; }

Property Value

DateTime?

IsComplete

Gets a value indicating whether the task is complete.

public bool IsComplete { get; }

Property Value

bool

IsRecurring

Gets a value indicating whether the task is recurring.

public bool IsRecurring { get; }

Property Value

bool

IsTeamTask

Gets a value indicating whether the task is a team task.

public bool IsTeamTask { get; }

Property Value

bool

Mileage

Gets or sets the mileage of the task.

public string Mileage { get; set; }

Property Value

string

Mode

Gets a value indicating the mode of the task.

public TaskMode Mode { get; }

Property Value

TaskMode

Owner

Gets the name of the owner of the task.

public string Owner { get; }

Property Value

string

PercentComplete

Gets or sets the completeion percentage of the task. PercentComplete must be between 0 and 100.

public double PercentComplete { get; set; }

Property Value

double

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

Recurrence

StartDate

Gets or sets the date and time on which the task starts.

public DateTime? StartDate { get; set; }

Property Value

DateTime?

Status

Gets or sets the status of the task.

public TaskStatus Status { get; set; }

Property Value

TaskStatus

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

string

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 ExchangeService

The service to use to bind to the task.

id ItemId

The 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 ExchangeService

The service to use to bind to the task.

id ItemId

The Id of the task to bind to.

propertySet PropertySet

The 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 DeleteMode

The 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 ConflictResolutionMode

Specifies 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.