本文整理汇总了C#中Definition.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Definition.GetName方法的具体用法?C# Definition.GetName怎么用?C# Definition.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Definition
的用法示例。
在下文中一共展示了Definition.GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateRelatedFeatureClass
/// <summary>
/// Given that the RelationshipClass is selected, this method will
/// 1. Get the Definitions of Datasets related by the selected relationship class
/// 2. Set the RelatedFeatureClass property to the Table/FeatureClass which is related to the FeatureClass corresponding to the selected layer
/// </summary>
public void UpdateRelatedFeatureClass()
{
QueuedTask.Run(() =>
{
using (Table table = (MapView.Active.Map.Layers.First(layer => layer.Name.Equals(SelectedLayer)) as FeatureLayer).GetTable())
{
Geodatabase geodatabase = null;
if (table != null && table.GetDatastore() is Geodatabase)
geodatabase = table.GetDatastore() as Geodatabase;
if (geodatabase == null) return;
if(SelectedRelationship == null) return;
IReadOnlyList<Definition> relatedDefinitions = geodatabase.GetRelatedDefinitions(geodatabase.GetDefinition<RelationshipClassDefinition>(SelectedRelationship),
DefinitionRelationshipType.DatasetsRelatedThrough);
relatedFeatureClassDefinition = relatedDefinitions.First(definition => definition.GetName() != table.GetDefinition().GetName());
RelatedFeatureClass = relatedFeatureClassDefinition.GetName();
}
});
}