LockButton_Click
(
object sender,
EventArgs e
)
{
AssertValid();
ICollection<IVertex> oSelectedVertices =
oNodeXLControl.SelectedVertices;
if (oSelectedVertices.Count == 0)
{
return;
}
// Lock or unlock the vertices.
Boolean bLockVertices = (sender == tsbLockVertices);
foreach (IVertex oVertex in oSelectedVertices)
{
if (bLockVertices)
{
oVertex.SetValue(ReservedMetadataKeys.LockVertexLocation,
true);
}
else
{
oVertex.RemoveKey(ReservedMetadataKeys.LockVertexLocation);
}
}
// Lock or unlock the vertices in the workbook.
EditedVertexAttributes oEditedVertexAttributes =
new EditedVertexAttributes();
oEditedVertexAttributes.Locked = bLockVertices;
FireAttributesEditedInGraph(null, oEditedVertexAttributes);
}