Inserts an element in the code arrangement.
Наследование: IElementInserter
Пример #1
0
        /// <summary>
        /// Creates an element inserter.
        /// </summary>
        /// <param name="elementType">Type of the element.</param>
        /// <param name="sortBy">The sort by.</param>
        /// <param name="groupBy">The group by.</param>
        /// <param name="parentConfiguration">The parent configuration.</param>
        /// <returns>An appropriate inserter.</returns>
        private static IElementInserter CreateElementInserter(
            ElementType elementType,
            SortBy sortBy,
            GroupBy groupBy,
            ConfigurationElement parentConfiguration)
        {
            IElementInserter inserter = null;

            if (sortBy != null)
            {
                inserter = new SortedInserter(elementType, sortBy);
            }

            if (groupBy != null && groupBy.InnerGroupBy != null)
            {
                inserter = new GroupedInserter(groupBy.InnerGroupBy, inserter);
            }

            if (groupBy != null)
            {
                inserter = new GroupedInserter(groupBy, inserter);
            }

            if (inserter == null)
            {
                inserter = new DefaultElementInserter();
            }

            return(inserter);
        }
Пример #2
0
        /// <summary>
        /// Creates an element inserter.
        /// </summary>
        /// <param name="elementType">Type of the element.</param>
        /// <param name="sortBy">The sort by.</param>
        /// <param name="groupBy">The group by.</param>
        /// <param name="parentConfiguration">The parent configuration.</param>
        /// <returns>An appropriate inserter.</returns>
        private static IElementInserter CreateElementInserter(
			ElementType elementType,
			SortBy sortBy,
			GroupBy groupBy,
			ConfigurationElement parentConfiguration)
        {
            IElementInserter inserter = null;

            if (sortBy != null)
            {
                inserter = new SortedInserter(elementType, sortBy);
            }

            if (groupBy != null && groupBy.InnerGroupBy != null)
            {
                inserter = new GroupedInserter(groupBy.InnerGroupBy, inserter);
            }

            if (groupBy != null)
            {
                inserter = new GroupedInserter(groupBy, inserter);
            }

            if (inserter == null)
            {
                inserter = new DefaultElementInserter();
            }

            return inserter;
        }