Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
 /// <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)));
 }
Ejemplo n.º 4
0
 /// <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)));
 }
Ejemplo n.º 5
0
 /// <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));
 }