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


C# IVertexType.GetIncomingEdgeDefinition方法代码示例

本文整理汇总了C#中IVertexType.GetIncomingEdgeDefinition方法的典型用法代码示例。如果您正苦于以下问题:C# IVertexType.GetIncomingEdgeDefinition方法的具体用法?C# IVertexType.GetIncomingEdgeDefinition怎么用?C# IVertexType.GetIncomingEdgeDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVertexType的用法示例。


在下文中一共展示了IVertexType.GetIncomingEdgeDefinition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckRemoveOutgoingEdges

        private void CheckRemoveOutgoingEdges(RequestAlterVertexType myAlterVertexTypeRequest, IVertexType myVertexType, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            if (myAlterVertexTypeRequest.ToBeRemovedOutgoingEdges == null)
                return;

            #region get the list of incoming edges that will be deleted too

            var toBeRemovedIncomingEdgeIDs = new List<long>();

            if (myAlterVertexTypeRequest.ToBeRemovedIncomingEdges != null)
                toBeRemovedIncomingEdgeIDs.AddRange(
                    myAlterVertexTypeRequest.ToBeRemovedIncomingEdges.Select(
                        _ => myVertexType.GetIncomingEdgeDefinition(_).ID));

            #endregion

            foreach (var aOutgoingEdge in myAlterVertexTypeRequest.ToBeRemovedOutgoingEdges)
            {
                var attrDef = myVertexType.GetOutgoingEdgeDefinition(aOutgoingEdge);

                var vertex = _vertexManager.ExecuteManager.GetVertex((long) BaseTypes.OutgoingEdge, attrDef.ID, null,
                                                                     null, myTransactionToken, mySecurityToken);

                var incomingEdges = vertex.GetIncomingVertices((long) BaseTypes.IncomingEdge,
                                                               (long)
                                                               AttributeDefinitions.IncomingEdgeDotRelatedEgde);

                foreach (var incomingEdge in incomingEdges)
                {
                    if (!toBeRemovedIncomingEdgeIDs.Contains(incomingEdge.VertexID))
                    {
                        //TODO a better exception here
                        throw new Exception(
                            "The outgoing edge can not be removed, because there are related incoming edges.");
                    }
                }
            }
        }
开发者ID:loubo,项目名称:sones,代码行数:38,代码来源:ExecuteVertexTypeManager.cs

示例2: ProcessIncomingEdgeRemoval

        private void ProcessIncomingEdgeRemoval(IEnumerable<string> myToBeRemovedIncomingEdges, IVertexType vertexType, TransactionToken myTransactionToken, SecurityToken mySecurityToken)
        {
            foreach (var aIncomingEdge in myToBeRemovedIncomingEdges)
            {
                var incomingEdgeDefinition = vertexType.GetIncomingEdgeDefinition(aIncomingEdge);

                _vertexManager.ExecuteManager.VertexStore.RemoveVertex(mySecurityToken, myTransactionToken, incomingEdgeDefinition.ID, (long)BaseTypes.IncomingEdge);
            }
        }
开发者ID:loubo,项目名称:sones,代码行数:9,代码来源:ExecuteVertexTypeManager.cs


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