示例#1
0
        /// <summary>
        /// Creates a copy of the current AggregateFilterContainer including new copies of all subcontainers, filters (including those in subcontainers) and paramaters of those
        /// filters.  This is a recursive operation that will clone the entire tree no matter how deep.
        /// </summary>
        /// <returns></returns>
        public AggregateFilterContainer DeepCloneEntireTreeRecursivelyIncludingFilters()
        {
            //clone ourselves
            AggregateFilterContainer clone = ShallowClone();

            //clone our filters
            foreach (AggregateFilter filterToClone in GetFilters())
            {
                //clone it
                AggregateFilter cloneFilter = filterToClone.ShallowClone(clone);

                //clone parameters
                foreach (AggregateFilterParameter parameterToClone in filterToClone.GetAllParameters())
                {
                    parameterToClone.ShallowClone(cloneFilter);
                }
            }

            //now clone all subcontainers
            foreach (AggregateFilterContainer toCloneSubcontainer in GetSubContainers())
            {
                //clone the subcontainer recursively
                AggregateFilterContainer clonedSubcontainer =
                    toCloneSubcontainer.DeepCloneEntireTreeRecursivelyIncludingFilters();

                //get the returned filter subcontainer and assocaite it with the cloned version of this
                clone.AddChild(clonedSubcontainer);
            }

            //return the cloned version
            return(clone);
        }
示例#2
0
        public AggregateFilter ShallowClone(AggregateFilterContainer into)
        {
            var clone = new AggregateFilter(CatalogueRepository, Name, into);

            CopyShallowValuesTo(clone);
            return(clone);
        }
示例#3
0
        public AggregateFilterParameter ShallowClone(AggregateFilter into)
        {
            var clone = new AggregateFilterParameter(CatalogueRepository, ParameterSQL, into);

            CopyShallowValuesTo(clone);
            return(clone);
        }
示例#4
0
 /// <summary>
 /// Declares a new parameter to be used by the specified AggregateFilter.  Use AggregateFilterFactory to call this
 /// constructor.
 /// </summary>
 /// <param name="repository"></param>
 /// <param name="parameterSQL"></param>
 /// <param name="parent"></param>
 internal AggregateFilterParameter(ICatalogueRepository repository, string parameterSQL, AggregateFilter parent)
 {
     repository.InsertAndHydrate(this, new Dictionary <string, object>
     {
         { "ParameterSQL", parameterSQL },
         { "AggregateFilter_ID", parent.ID }
     });
 }
示例#5
0
 /// <inheritdoc/>
 public IQuerySyntaxHelper GetQuerySyntaxHelper()
 {
     return(AggregateFilter.GetQuerySyntaxHelper());
 }