/// <summary> /// Determines whether the specified field <paramref name="index" /> on the <paramref name="table" /> is editable by /// both ESRI and ArcFM. /// </summary> /// <param name="table">The object class.</param> /// <param name="index">The index.</param> /// <returns> /// <c>true</c> if the specified field index on the class is editable by both ESRI and ArcFM; otherwise, <c>false</c>. /// </returns> /// <exception cref="System.ArgumentNullException">table</exception> /// <exception cref="System.IndexOutOfRangeException"></exception> protected virtual bool IsEditable(IObjectClass table, int index) { if (table == null) { throw new ArgumentNullException("table"); } if (index < 0 || index > table.Fields.FieldCount - 1) { throw new IndexOutOfRangeException(); } IField field = table.Fields.Field[index]; if (field.Editable) { ISubtypes subtypes = (ISubtypes)table; if (!_FieldManagersByClassID.ContainsKey(table.ObjectClassID)) { _FieldManagersByClassID.Add(table.ObjectClassID, table.GetFieldManager(subtypes.DefaultSubtypeCode)); } IMMFieldManager fieldManager = _FieldManagersByClassID[table.ObjectClassID]; IMMFieldAdapter fieldAdapter = fieldManager.FieldByIndex(index); return(fieldAdapter.Editable); } return(false); }
/// <summary> /// Gets the field manager for the specified <paramref name="source" /> /// </summary> /// <param name="source">The source.</param> /// <param name="subtypeCode">The subtype code.</param> /// <param name="auxiliaryFieldBuilder">The auxiliary field builder.</param> /// <returns> /// Returns the <see cref="IMMFieldManager" /> representing the properties for the class. /// </returns> public static IMMFieldManager GetFieldManager(this ITable source, int subtypeCode, IMMAuxiliaryFieldBuilder auxiliaryFieldBuilder) { if (source == null) { return(null); } IObjectClass table = source as IObjectClass; if (table == null) { return(null); } return(table.GetFieldManager(subtypeCode, auxiliaryFieldBuilder)); }
/// <summary> /// Gets the field manager for the specified <paramref name="source" /> /// </summary> /// <param name="source">The source.</param> /// <param name="subtypeCode">The subtype code.</param> /// <param name="auxiliaryFieldBuilder">The auxiliary field builder.</param> /// <returns> /// Returns the <see cref="IMMFieldManager" /> representing the properties for the class. /// </returns> public static IMMFieldManager GetFieldManagerAsync(this IObjectClass source, int subtypeCode, IMMAuxiliaryFieldBuilder auxiliaryFieldBuilder) { return(Task.Wait(() => source.GetFieldManager(subtypeCode, auxiliaryFieldBuilder))); }
/// <summary> /// Gets the field manager for the specified <paramref name="source" /> /// </summary> /// <param name="source">The source.</param> /// <param name="subtypeCode">The subtype code.</param> /// <returns> /// Returns the <see cref="IMMFieldManager" /> representing the properties for the class. /// </returns> public static IMMFieldManager GetFieldManagerAsync(this IObjectClass source, int subtypeCode) { return(Task.Wait(() => source.GetFieldManager(subtypeCode))); }
/// <summary> /// Gets the field manager for the specified <paramref name="source" /> /// </summary> /// <param name="source">The source.</param> /// <param name="subtypeCode">The subtype code.</param> /// <returns> /// Returns the <see cref="IMMFieldManager" /> representing the properties for the class. /// </returns> public static IMMFieldManager GetFieldManager(this IObjectClass source, int subtypeCode) { return(source.GetFieldManager(subtypeCode, null)); }