本文整理汇总了C#中Dynamo.Nodes.List.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# List.Insert方法的具体用法?C# List.Insert怎么用?C# List.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Nodes.List
的用法示例。
在下文中一共展示了List.Insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteModelInternal
internal void DeleteModelInternal(List<ModelBase> modelsToDelete)
{
if (null == CurrentWorkspace)
return;
//Check for empty group
var annotations = Workspaces.SelectMany(ws => ws.Annotations);
foreach (var annotation in annotations)
{
//record the annotation before the models in it are deleted.
foreach (var model in modelsToDelete)
{
//If there is only one model, then deleting that model should delete the group. In that case, do not record
//the group for modification. Until we have one model in a group, group should be recorded for modification
//otherwise, undo operation cannot get the group back.
if (annotation.SelectedModels.Count() > 1 && annotation.SelectedModels.Where(x => x.GUID == model.GUID).Any())
{
CurrentWorkspace.RecordGroupModelBeforeUngroup(annotation);
}
}
if (annotation.SelectedModels.Any() && !annotation.SelectedModels.Except(modelsToDelete).Any())
{
//Annotation Model has to be serialized first - before the nodes.
//so, store the Annotation model as first object. This will serialize the
//annotation before the nodes are deleted. So, when Undo is pressed,
//annotation model is deserialized correctly.
modelsToDelete.Insert(0, annotation);
}
}
OnDeletionStarted();
CurrentWorkspace.RecordAndDeleteModels(modelsToDelete);
var selection = DynamoSelection.Instance.Selection;
foreach (ModelBase model in modelsToDelete)
{
selection.Remove(model); // Remove from selection set.
model.Dispose();
}
OnDeletionComplete(this, EventArgs.Empty);
}