本文整理汇总了C#中IVertexType.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IVertexType.GetType方法的具体用法?C# IVertexType.GetType怎么用?C# IVertexType.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVertexType
的用法示例。
在下文中一共展示了IVertexType.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateOutput
/// <summary>
/// Generate an output for an type with the attributes of the types and all parent types
/// </summary>
/// <param name="myDBContext">The db context</param>
/// <param name="myType">The db type</param>
/// <param name="myDepth">If depth == 0 only the type basic attributes will be returned</param>
private IVertexView GenerateOutput(IVertexType myType, Int32 myDepth = 0)
{
var retVal = new Dictionary<String, object>();
List<IVertexView> result = new List<IVertexView>();
var edges = new Dictionary<String, IEdgeView>();
//base output
retVal.Add("VertexID", myType.ID);
retVal.Add("Type", myType.GetType().Name);
retVal.Add("Name", myType.Name);
retVal.Add("IsUserDefined", myType.IsUserDefined);
//additional output
if (myDepth > 0)
{
retVal.Add("IsAbstract", myType.IsAbstract);
edges.Add("Properties", new HyperEdgeView(null, GeneratePropertiesOutput(myType, myType.GetPropertyDefinitions(true), myDepth)));
edges.Add("Edges", new HyperEdgeView(null, GenerateEdgesOutput(myType, myType.GetOutgoingEdgeDefinitions(true))));
edges.Add("Incomingedges", new HyperEdgeView(null, GenerateEdgesOutput(myType, myType.GetIncomingEdgeDefinitions(true))));
edges.Add("UniqueAttributes", new HyperEdgeView(null, GenerateUniquePropertiesOutput(myType, myType.GetUniqueDefinitions(true))));
edges.Add("Indices", new HyperEdgeView(null, GenerateIndicesOutput(myType)));
if (myType.HasParentType)
edges.Add("Extends", new SingleEdgeView(null, GenerateOutput(myType.ParentVertexType)));
if (myType.HasChildTypes)
{
List<ISingleEdgeView> list = new List<ISingleEdgeView>();
foreach (var child in myType.ChildrenVertexTypes)
list.Add(new SingleEdgeView(null, GenerateOutput(child)));
edges.Add("ChildrenVertexTypes", new HyperEdgeView(null, list));
}
if (!string.IsNullOrWhiteSpace(myType.Comment))
retVal.Add("Comment", myType.Comment);
}
return new VertexView(retVal, edges);
}