Equals

Equals(TaskLink)

Returns a value indicating whether this instance is equal to a specified object.

public bool Equals(TaskLink other)
ParameterTypeDescription
otherTaskLinkThe specified instance of the TaskLink class to compare with this instance.

Return Value

True if the specified instance of the TaskLink class has the same predecessor and successor tasks as this instance; otherwise, false.

Examples

Shows how to check equality of task links.

var project = new Project(DataDir + "GetPredecessorSuccessorTasks.mpp");

var link1 = project.TaskLinks[0];
var link2 = project.TaskLinks[1];

// the equality of task links is based on pred and succ tasks.
Console.Write("Link 1 Pred: " + link1.PredTask.ToString());
Console.Write("Link 1 Succ: " + link1.SuccTask.ToString());
Console.Write("Link 2 Pred: " + link2.PredTask.ToString());
Console.Write("Link 2 Succ: " + link2.SuccTask.ToString());
Console.Write("Are task links equal: " + link1.Equals(link2));

See Also


Equals(object)

Returns a value indicating whether this instance is equal to a specified object.

public override bool Equals(object obj)
ParameterTypeDescription
objObjectThe object to compare with this instance.

Return Value

True if the specified object is a TaskLink that has the same predecessor and successor as this instance; otherwise, false.

Examples

Shows how to check equality of task links.

var project = new Project(DataDir + "GetPredecessorSuccessorTasks.mpp");

var link1 = project.TaskLinks[0];
var link2 = project.TaskLinks[1];

// the equality of task links is based on pred and succ tasks.
Console.Write("Link 1 Pred: " + link1.PredTask.ToString());
Console.Write("Link 1 Succ: " + link1.SuccTask.ToString());
Console.Write("Link 2 Pred: " + link2.PredTask.ToString());
Console.Write("Link 2 Succ: " + link2.SuccTask.ToString());
Console.Write("Are task links equal: " + link1.Equals(link2));

See Also