本文整理匯總了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();
}