LinksChangingEventArgs
Provides data for the Gantt chart's GanttChart.LinksChanging event: links the reader
is about to add to the plan or remove from it, all leading into one task.
public class LinksChangingEventArgs : CancelEventArgs
Inherits from / implements: CancelEventArgs
Remarks
Drawing a link from one bar to another adds one finish-to-start link. Typing into a task's
Predecessors cell replaces the links into the task with the ones typed; a link typed exactly as it
already is stays, with its Id, so only the differences are listed – new links in
Added, dropped ones in Removed. (The Windows Forms chart also removes a
selected link with Delete.)
Set CancelEventArgs.Cancel to true to refuse the whole change.
Otherwise Removed are removed from the chart's Links collection and
Added are added to it.
Examples
gantt.LinksChanging += (sender, e) =>
{
// Give each new link an id from the application's own sequence before it is stored.
foreach (TaskLink link in e.Added)
{
link.Id = "L" + (++lastLinkNumber).ToString();
}
};Members at a glance
| Constructors | |
|---|---|
LinksChangingEventArgs | Creates the data for a proposed change to the links into a task. |
| Properties | |
Added | Gets the new link objects that would be added to the links collection. |
Removed | Gets the links, from the links collection, that would be removed from it. |
Source | Gets how the change was made. |
TaskId | Gets the id of the task whose incoming links change: the successor of every link in
Added and Removed. |
Constructors
LinksChangingEventArgs
Creates the data for a proposed change to the links into a task.
Parameters
taskId- The id of the task whose incoming links change.
source- How the change was made.
added- Links that would be added;
nullfor none. removed- Links that would be removed;
nullfor none.
Properties
Added
Gets the new link objects that would be added to the links collection.
- Value
- Never
null; empty when nothing is added. The objects can be changed before they are stored – given an id, say.
Removed
Gets the links, from the links collection, that would be removed from it.
- Value
- Never
null; empty when nothing is removed.
Source
Gets how the change was made.