本文整理汇总了C#中WorkspaceModel.RemoveGroup方法的典型用法代码示例。如果您正苦于以下问题:C# WorkspaceModel.RemoveGroup方法的具体用法?C# WorkspaceModel.RemoveGroup怎么用?C# WorkspaceModel.RemoveGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorkspaceModel
的用法示例。
在下文中一共展示了WorkspaceModel.RemoveGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Collapse
//.........这里部分代码省略.........
}
#endregion
#region Transfer nodes and connectors to new workspace
var newNodes = new List<NodeModel>();
var newAnnotations = new List<AnnotationModel>();
// Step 4: move all nodes 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);
}
//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>>();
var uniqueInputSenders = new Dictionary<Tuple<NodeModel, int>, Symbol>();
//Step 3: insert variables (reference step 1)
foreach (var input in Enumerable.Range(0, inputs.Count).Zip(inputs, Tuple.Create))
{
int inputIndex = input.Item1;
NodeModel inputReceiverNode = input.Item2.Item1;
int inputReceiverData = input.Item2.Item2;
NodeModel inputNode = input.Item2.Item3.Item2;
int inputData = input.Item2.Item3.Item1;