本文整理汇总了C#中TSqlObject.GetChildren方法的典型用法代码示例。如果您正苦于以下问题:C# TSqlObject.GetChildren方法的具体用法?C# TSqlObject.GetChildren怎么用?C# TSqlObject.GetChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSqlObject
的用法示例。
在下文中一共展示了TSqlObject.GetChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DumpChildren
static void DumpChildren(TSqlObject parent, int depth)
{
DumpScript(parent);
foreach (var property in parent.ObjectType.Properties)
{
DumpProperty(property, parent);
}
foreach (var child in parent.GetChildren())
{
DumpChildren(child, depth + 1);
}
}
示例2: DisplyChildObjects
private void DisplyChildObjects(string rootNodeHader, TreeViewItem currentObjectTreeViewItem,
TSqlObject currentObject, Dictionary<string, TreeViewItem> childObjectTypes)
{
var children = currentObject.GetChildren();
foreach (var child in children.OrderBy(p => p, new SqlObjectComparer()))
{
var type = child.ObjectType.Name;
var typeContainerHeader = GetContainerHeader(type);
if (!childObjectTypes.ContainsKey(typeContainerHeader))
{
var item = AddTreeItem(typeContainerHeader, currentObjectTreeViewItem, _defaultForeground);
childObjectTypes.Add(typeContainerHeader, item);
}
var childTreeViewItem = AddTreeItem(child.Name.ToString(), childObjectTypes[typeContainerHeader],
_defaultForeground);
DisplayObject(rootNodeHader, child, childTreeViewItem);
}
var repository = ModelRepository.GetRepository();
if (repository.LoadScriptDom())
{
TSqlFragment fragment;
TSqlModelUtils.TryGetFragmentForAnalysis(currentObject, out fragment);
var frgPrc = new TSqlFragmentProcess.TSqlFragmentProcess(this);
frgPrc.ProcessTSQLFragment(fragment, currentObjectTreeViewItem);
}
}
示例3: GetKeyColumns
private List<string> GetKeyColumns(TSqlObject table)
{
var keys = new List<string>();
var primaryKey = table.GetChildren().FirstOrDefault(p => p.ObjectType == ModelSchema.PrimaryKeyConstraint);
if (null == primaryKey)
return keys;
foreach (var column in primaryKey.GetReferencedRelationshipInstances(PrimaryKeyConstraint.Columns))
{
keys.Add(column.ObjectName.GetName());
}
return keys;
}