本文整理汇总了C#中IExpressionGraph.GetLevel方法的典型用法代码示例。如果您正苦于以下问题:C# IExpressionGraph.GetLevel方法的具体用法?C# IExpressionGraph.GetLevel怎么用?C# IExpressionGraph.GetLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExpressionGraph
的用法示例。
在下文中一共展示了IExpressionGraph.GetLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CleanLowerLevel
private static void CleanLowerLevel(LevelKey myLevelKey, IExpressionGraph myGraph, IGraphDB myGraphDB, SecurityToken mySecurityToken, Int64 myTransactionToken)
{
if (myLevelKey.Level > 0)
{
var previousLevelKey = myLevelKey.GetPredecessorLevel(myGraphDB, mySecurityToken, myTransactionToken);
HashSet<VertexInformation> toBeDeletedNodes = new HashSet<VertexInformation>();
foreach (var aLowerDBO in myGraph.Select(previousLevelKey, null, false))
{
if (aLowerDBO.HasOutgoingEdge(myLevelKey.LastEdge.AttributeID))
{
foreach (var aVertex in aLowerDBO.GetOutgoingEdge(myLevelKey.LastEdge.AttributeID).GetTargetVertices())
{
//took the vertextype id of the levelkey, because it is possible that the vertextypeid of the vertex is something inheritated
VertexInformation node = new VertexInformation(aVertex.VertexTypeID, aVertex.VertexID);
if (!myGraph.GetLevel(myLevelKey.Level).ExpressionLevels[myLevelKey].Nodes.ContainsKey(node))
{
//a reference occurred that is not in the higher level --> found a Zoidberg
toBeDeletedNodes.Add(node);
break;
}
}
}
}
foreach (var aToBeDeletedNode in toBeDeletedNodes)
{
myGraph.GetLevel(previousLevelKey.Level).RemoveNode(previousLevelKey, aToBeDeletedNode);
}
}
}
示例2: CleanLowerLevel
private void CleanLowerLevel(LevelKey myLevelKey, DBContext dbContext, DBObjectCache dbObjectCache, IExpressionGraph myGraph)
{
if (myLevelKey.Level > 0)
{
var previousLevelKey = myLevelKey.GetPredecessorLevel(dbContext.DBTypeManager);
HashSet<ObjectUUID> toBeDeletedNodes = new HashSet<ObjectUUID>();
foreach (var aLowerDBO in myGraph.Select(previousLevelKey, null, false))
{
if(aLowerDBO.Failed())
{
throw new GraphDBException(new Error_ExpressionGraphInternal(new System.Diagnostics.StackTrace(true), "Could not load DBObjectStream from lower level."));
}
foreach (var aReferenceUUID in ((IReferenceEdge)aLowerDBO.Value.GetAttribute(myLevelKey.LastEdge.AttrUUID)).GetAllReferenceIDs())
{
if (!myGraph.GetLevel(myLevelKey.Level).ExpressionLevels[myLevelKey].Nodes.ContainsKey(aReferenceUUID))
{
//a reference occurred that is not in the higher level --> found a Zoidberg
toBeDeletedNodes.Add(aLowerDBO.Value.ObjectUUID);
break;
}
}
}
foreach (var aToBeDeletedNode in toBeDeletedNodes)
{
myGraph.GetLevel(previousLevelKey.Level).RemoveNode(previousLevelKey, aToBeDeletedNode);
}
}
}