/// <summary> /// Finds the <see cref="IRelationshipClass" /> using the specified <paramref name="source" /> and /// <paramref name="relationshipRole" /> that has been assigned the <paramref name="modelName" />. /// </summary> /// <param name="source">The object class.</param> /// <param name="relationshipRole">The relationship role.</param> /// <param name="modelName">The class model name.</param> /// <param name="throwException"> /// if set to <c>true</c> if an exception should be thrown when the model name is not /// assigned. /// </param> /// <returns> /// Returns a <see cref="ESRI.ArcGIS.Geodatabase.IRelationshipClass" /> representing the relationship assigned any of /// the class model names, otherwise <c>null</c>. /// </returns> /// <exception cref="ArgumentNullException">modelName</exception> /// <exception cref="MissingClassModelNameException"></exception> public static IRelationshipClass GetRelationshipClass(this IObjectClass source, esriRelRole relationshipRole, string modelName, bool throwException) { if (source == null) { return(null); } if (modelName == null) { throw new ArgumentNullException("modelName"); } return(source.GetRelationshipClass(relationshipRole, new[] { modelName }, throwException)); }
/// <summary> /// Finds the <see cref="IRelationshipClass" /> using the specified <paramref name="source" /> and /// <paramref name="relationshipRole" /> that has been assigned /// any of the <paramref name="modelNames" />. /// </summary> /// <param name="source">The table.</param> /// <param name="relationshipRole">The relationship role.</param> /// <param name="modelNames">The class model names.</param> /// <param name="throwException"> /// if set to <c>true</c> if an exception should be thrown when the model name is not /// assigned. /// </param> /// <returns> /// Returns a <see cref="ESRI.ArcGIS.Geodatabase.IRelationshipClass" /> representing the relationship assigned any of /// the class model names. /// </returns> /// <exception cref="MissingClassModelNameException"></exception> public static IRelationshipClass GetRelationshipClass(this ITable source, esriRelRole relationshipRole, string[] modelNames, bool throwException) { if (source == null) { return(null); } IObjectClass table = source as IObjectClass; if (table == null) { return(null); } return(table.GetRelationshipClass(relationshipRole, modelNames, throwException)); }
/// <summary> /// Finds the <see cref="IRelationshipClass" /> using the specified <paramref name="source" /> and /// <paramref name="relationshipRole" /> that has been assigned any of the <paramref name="modelNames" />. /// </summary> /// <param name="source">The object class.</param> /// <param name="relationshipRole">The relationship role.</param> /// <param name="modelNames">The class model names.</param> /// <param name="throwException"> /// if set to <c>true</c> if an exception should be thrown when the model name is not /// assigned. /// </param> /// <returns> /// Returns a <see cref="ESRI.ArcGIS.Geodatabase.IRelationshipClass" /> representing the relationship assigned any of /// the class model names, otherwise <c>null</c>. /// </returns> /// <exception cref="ArgumentNullException">modelNames</exception> /// <exception cref="MissingClassModelNameException"></exception> public static IRelationshipClass GetRelationshipClassAsync(this IObjectClass source, esriRelRole relationshipRole, string[] modelNames, bool throwException) { return(Task.Wait(() => source.GetRelationshipClass(relationshipRole, modelNames, throwException))); }
/// <summary> /// Finds the <see cref="IRelationshipClass" /> using the specified <paramref name="source" /> and /// <paramref name="relationshipRole" /> that has been assigned the <paramref name="modelName" />. /// </summary> /// <param name="source">The object class.</param> /// <param name="relationshipRole">The relationship role.</param> /// <param name="modelName">The class model name.</param> /// <returns> /// Returns a <see cref="ESRI.ArcGIS.Geodatabase.IRelationshipClass" /> representing the relationship assigned any of /// the class model names, otherwise <c>null</c>. /// </returns> /// <exception cref="ArgumentNullException">modelName</exception> /// <exception cref="MissingClassModelNameException"></exception> public static IRelationshipClass GetRelationshipClassAsync(this IObjectClass source, esriRelRole relationshipRole, string modelName) { return(Task.Wait(() => source.GetRelationshipClass(relationshipRole, modelName))); }
/// <summary> /// Finds the <see cref="IRelationshipClass" /> using the specified <paramref name="source" /> and /// <paramref name="relationshipRole" /> that has been assigned any of the <paramref name="modelNames" />. /// </summary> /// <param name="source">The object class.</param> /// <param name="relationshipRole">The relationship role.</param> /// <param name="modelNames">The class model names.</param> /// <returns> /// Returns a <see cref="ESRI.ArcGIS.Geodatabase.IRelationshipClass" /> representing the relationship assigned any of /// the class model names, otherwise <c>null</c>. /// </returns> /// <exception cref="ArgumentNullException">modelNames</exception> /// <exception cref="MissingClassModelNameException"></exception> public static IRelationshipClass GetRelationshipClass(this IObjectClass source, esriRelRole relationshipRole, string[] modelNames) { return(source.GetRelationshipClass(relationshipRole, modelNames, true)); }