本文整理汇总了C#中sones.GraphDB.TypeManagement.GraphDBType.GetParentType方法的典型用法代码示例。如果您正苦于以下问题:C# GraphDBType.GetParentType方法的具体用法?C# GraphDBType.GetParentType怎么用?C# GraphDBType.GetParentType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sones.GraphDB.TypeManagement.GraphDBType
的用法示例。
在下文中一共展示了GraphDBType.GetParentType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllParentTypes
/// <summary>
/// Get all parent type (the type from which the <paramref name="myType"/> derives)
/// </summary>
/// <param name="myType"></param>
/// <param name="myThisTypeIncluding">If true, the <paramref name="myType"/> is added to the result.</param>
/// <returns></returns>
public IEnumerable<GraphDBType> GetAllParentTypes(GraphDBType myType, Boolean myThisTypeIncluding, Boolean includeSystemTypes)
{
#region INPUT EXCEPTIONS
if (myType == null)
{
throw new GraphDBException(new Error_ArgumentNullOrEmpty("DBType should not be null."));
}
#endregion
List<GraphDBType> result = new List<GraphDBType>();
if (myThisTypeIncluding)
result.Add(myType);
if (myType.ParentTypeUUID != null)
{
if (myType.GetParentType(this).IsUserDefined)
{
result.AddRange(GetAllParentTypes(myType.GetParentType(this), true, includeSystemTypes));
}
else
{
if (includeSystemTypes)
{
result.AddRange(GetAllParentTypes(myType.GetParentType(this), true, includeSystemTypes));
}
}
}
return result;
}
示例2: CreateGraphDDL
private String CreateGraphDDL(DumpFormats myDumpFormat, GraphDBType myGraphDBType, DBContext myDBContext)
{
var stringBuilder = new StringBuilder();
stringBuilder.AppendFormat("{0} ", myGraphDBType.Name);
if (myGraphDBType.ParentTypeUUID != null)
{
stringBuilder.AppendFormat("{0} {1} ", S_EXTENDS.ToUpperString(), myGraphDBType.GetParentType(myDBContext.DBTypeManager).Name);//builder.AppendLine();
#region Not backwardEdge attributes
if (myGraphDBType.GetFilteredAttributes(ta => !ta.IsBackwardEdge).CountIsGreater(0))
{
stringBuilder.Append(S_ATTRIBUTES.ToUpperString() + S_BRACKET_LEFT.ToUpperString() + CreateGraphDDLOfAttributes(myDumpFormat, myGraphDBType.GetFilteredAttributes(ta => !ta.IsBackwardEdge), myDBContext) + S_BRACKET_RIGHT.ToUpperString() + " ");
}
#endregion
#region BackwardEdge attributes
if (myGraphDBType.GetFilteredAttributes(ta => ta.IsBackwardEdge).CountIsGreater(0))
{
stringBuilder.Append(S_BACKWARDEDGES.ToUpperString() + S_BRACKET_LEFT.ToUpperString() + CreateGraphDDLOfBackwardEdges(myDumpFormat, myGraphDBType.GetFilteredAttributes(ta => ta.IsBackwardEdge), myDBContext) + S_BRACKET_RIGHT.ToUpperString() + " ");
}
#endregion
#region Uniques
if (myGraphDBType.GetUniqueAttributes().CountIsGreater(0))
{
stringBuilder.Append(S_UNIQUE.ToUpperString() + S_BRACKET_LEFT.Symbol + CreateGraphDDLOfAttributeUUIDs(myDumpFormat, myGraphDBType.GetUniqueAttributes(), myGraphDBType) + S_BRACKET_RIGHT.Symbol + " ");
}
#endregion
#region Mandatory attributes
if (myGraphDBType.GetMandatoryAttributes().CountIsGreater(0))
{
stringBuilder.Append(S_MANDATORY.ToUpperString() + S_BRACKET_LEFT.Symbol + CreateGraphDDLOfAttributeUUIDs(myDumpFormat, myGraphDBType.GetMandatoryAttributes(), myGraphDBType) + S_BRACKET_RIGHT.Symbol + " ");
}
#endregion
#region Indices
if (myGraphDBType.GetAllAttributeIndices(false).CountIsGreater(0))
{
stringBuilder.Append(S_INDICES.ToUpperString() + S_BRACKET_LEFT.Symbol + CreateGraphDDLOfIndices(myDumpFormat, myGraphDBType.GetAllAttributeIndices(false), myGraphDBType) + S_BRACKET_RIGHT.Symbol + " ");
}
#endregion
}
return stringBuilder.ToString();
}