当前位置: 首页>>代码示例>>C#>>正文


C# IExpressionGraph.GetLevel方法代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:ramz,项目名称:sones,代码行数:33,代码来源:ABinaryCompareOperator.cs

示例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);
                }
            }
        }
开发者ID:Vadi,项目名称:sones,代码行数:32,代码来源:ABinaryCompareOperator.cs


注:本文中的IExpressionGraph.GetLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。