Esempio n. 1
0
        public virtual object PublishClone(AutomaticSubtotalContext context)
        {
            DataAggregateInfo dataAggregateInfo = (DataAggregateInfo)base.MemberwiseClone();

            if (dataAggregateInfo.m_publishingInfo != null)
            {
                dataAggregateInfo.m_publishingInfo = this.m_publishingInfo.PublishClone();
                dataAggregateInfo.m_publishingInfo.NestedAggregates = null;
            }
            dataAggregateInfo.m_name = context.CreateAggregateID(this.m_name);
            bool flag = false;

            if (context.OuterAggregate != null)
            {
                flag = true;
                context.OuterAggregate.AddNestedAggregate(dataAggregateInfo);
            }
            if (this.IsAggregateOfAggregate)
            {
                context.OuterAggregate = dataAggregateInfo;
            }
            if (this.PublishingInfo.HasScope)
            {
                if (flag)
                {
                    dataAggregateInfo.SetScope(context.GetNewScopeNameForInnerOrOuterAggregate(this));
                }
                else
                {
                    dataAggregateInfo.SetScope(context.GetNewScopeName(this.PublishingInfo.Scope));
                }
            }
            if (this.m_expressions != null)
            {
                dataAggregateInfo.m_expressions = new ExpressionInfo[this.m_expressions.Length];
                for (int i = 0; i < this.m_expressions.Length; i++)
                {
                    dataAggregateInfo.m_expressions[i] = (ExpressionInfo)this.m_expressions[i].PublishClone(context);
                }
            }
            return(dataAggregateInfo);
        }
        public DataAggregateInfo GetAsAggregate()
        {
            DataAggregateInfo dataAggregateInfo = null;

            if (base.AggregateType != AggregateTypes.Previous)
            {
                dataAggregateInfo = new DataAggregateInfo();
                dataAggregateInfo.AggregateType = base.AggregateType;
                dataAggregateInfo.Expressions   = base.Expressions;
                dataAggregateInfo.SetScope(this.m_scope);
            }
            return(dataAggregateInfo);
        }