本文整理汇总了C#中WorkspaceModel.RemoveNote方法的典型用法代码示例。如果您正苦于以下问题:C# WorkspaceModel.RemoveNote方法的具体用法?C# WorkspaceModel.RemoveNote怎么用?C# WorkspaceModel.RemoveNote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorkspaceModel
的用法示例。
在下文中一共展示了WorkspaceModel.RemoveNote方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Collapse
//.........这里部分代码省略.........
}
#endregion
#region Transfer nodes and connectors to new workspace
var newNodes = new List<NodeModel>();
var newNotes = new List<NoteModel>();
var newAnnotations = new List<AnnotationModel>();
// Step 4: move all nodes and notes to new workspace remove from old
// PB: This could be more efficiently handled by a copy paste, but we
// are preservering the node
foreach (var node in selectedNodeSet)
{
undoRecorder.RecordDeletionForUndo(node);
currentWorkspace.RemoveNode(node);
// Assign a new guid to this node, otherwise when node is
// compiled to AST, literally it is still in global scope
// instead of in function scope.
node.GUID = Guid.NewGuid();
// shift nodes
node.X = node.X - leftShift;
node.Y = node.Y - topMost;
newNodes.Add(node);
}
foreach(var note in selectedNotes)
{
undoRecorder.RecordDeletionForUndo(note);
currentWorkspace.RemoveNote(note);
note.GUID = Guid.NewGuid();
note.X = note.X - leftShift;
note.Y = note.Y - topMost;
newNotes.Add(note);
}
//Copy the group from newNodes
foreach (var group in DynamoSelection.Instance.Selection.OfType<AnnotationModel>())
{
undoRecorder.RecordDeletionForUndo(group);
currentWorkspace.RemoveGroup(group);
group.GUID = Guid.NewGuid();
group.SelectedModels = group.DeletedModelBases;
newAnnotations.Add(group);
}
// Now all selected nodes already moved to custom workspace,
// clear the selection.
DynamoSelection.Instance.ClearSelection();
foreach (var conn in fullySelectedConns)
{
ConnectorModel.Make(conn.Start.Owner, conn.End.Owner, conn.Start.Index, conn.End.Index);
}
#endregion
#region Process inputs
var inConnectors = new List<Tuple<NodeModel, int>>();