本文整理汇总了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.");
}
}
}
}
示例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);
}
}