Пример #1
0
        /// <summary>
        /// Gets all of the automatic values (i.e. ArcFM Auto Updaters) that have been configured for the subtype.
        /// </summary>
        /// <param name="source">The relationship class.</param>
        /// <param name="editEvent">The edit event.</param>
        /// <returns>
        /// Returns a <see cref="IEnumerable{IMMAutoValue}" /> objects that have been assigned to the field.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">table</exception>
        public static IEnumerable <IMMAutoValue> GetAutoValues(this IMMRelationshipClass source, mmEditEvent editEvent)
        {
            var list = source as ID8List;

            if (list == null)
            {
                return(null);
            }

            var values = list.Where(i => i.ItemType == mmd8ItemType.mmitAutoValue, 0).Select(o => o.Value);

            return(values.OfType <IMMAutoValue>().Where(o => o.AutoGenID != null && o.EditEvent == editEvent));
        }
Пример #2
0
        /// <summary>
        ///     Gets all of the automatic values (i.e. ArcFM Auto Updaters) that have been configured for the specified
        ///     <paramref name="editEvent" /> the <paramref name="relationshipClass" /> relationship class.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="relationshipClass">The relationship class.</param>
        /// <param name="editEvent">The edit event.</param>
        /// <returns>
        ///     Returns a <see cref="IEnumerable{IMMAutoValue}" /> representing the automatic values for the specified event and
        ///     object class.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">table</exception>
        public static IEnumerable <IMMAutoValue> GetAutoValues(this IMMConfigTopLevel source, IRelationshipClass relationshipClass, mmEditEvent editEvent)
        {
            if (source == null)
            {
                return(null);
            }
            if (relationshipClass == null)
            {
                throw new ArgumentNullException("relationshipClass");
            }

            IEnumerable <IMMAutoValue> list = new List <IMMAutoValue>();

            IMMRelationshipClass relationship = source.GetRelationshipClass(relationshipClass);

            if (relationship.HasAutoUpdater)
            {
                list = relationship.GetAutoValues(editEvent);
            }

            return(list);
        }