internal SLPivotCacheDefinition Clone()
        {
            SLPivotCacheDefinition pcd = new SLPivotCacheDefinition();
            pcd.Id = this.Id;
            pcd.Invalid = this.Invalid;
            pcd.SaveData = this.SaveData;
            pcd.RefreshOnLoad = this.RefreshOnLoad;
            pcd.OptimizeMemory = this.OptimizeMemory;
            pcd.EnableRefresh = this.EnableRefresh;
            pcd.RefreshedBy = this.RefreshedBy;
            pcd.RefreshedDate = this.RefreshedDate.Value;
            pcd.BackgroundQuery = this.BackgroundQuery;
            pcd.MissingItemsLimit = this.MissingItemsLimit.Value;
            pcd.CreatedVersion = this.CreatedVersion;
            pcd.RefreshedVersion = this.RefreshedVersion;
            pcd.MinRefreshableVersion = this.MinRefreshableVersion;
            pcd.RecordCount = this.RecordCount.Value;
            pcd.UpgradeOnRefresh = this.UpgradeOnRefresh;
            pcd.IsTupleCache = this.IsTupleCache;
            pcd.SupportSubquery = this.SupportSubquery;
            pcd.SupportAdvancedDrill = this.SupportAdvancedDrill;

            pcd.CacheSource = this.CacheSource.Clone();

            pcd.CacheFields = new List<SLCacheField>();
            foreach (SLCacheField cf in this.CacheFields)
            {
                pcd.CacheFields.Add(cf.Clone());
            }

            pcd.CacheHierarchies = new List<SLCacheHierarchy>();
            foreach (SLCacheHierarchy ch in this.CacheHierarchies)
            {
                pcd.CacheHierarchies.Add(ch.Clone());
            }

            pcd.Kpis = new List<SLKpi>();
            foreach (SLKpi k in this.Kpis)
            {
                pcd.Kpis.Add(k.Clone());
            }

            pcd.HasTupleCache = this.HasTupleCache;
            pcd.TupleCache = this.TupleCache.Clone();

            pcd.CalculatedItems = new List<SLCalculatedItem>();
            foreach (SLCalculatedItem ci in this.CalculatedItems)
            {
                pcd.CalculatedItems.Add(ci.Clone());
            }

            pcd.CalculatedMembers = new List<SLCalculatedMember>();
            foreach (SLCalculatedMember cm in this.CalculatedMembers)
            {
                pcd.CalculatedMembers.Add(cm.Clone());
            }

            pcd.Dimensions = new List<SLDimension>();
            foreach (SLDimension d in this.Dimensions)
            {
                pcd.Dimensions.Add(d.Clone());
            }

            pcd.MeasureGroups = new List<SLMeasureGroup>();
            foreach (SLMeasureGroup mg in this.MeasureGroups)
            {
                pcd.MeasureGroups.Add(mg.Clone());
            }

            pcd.Maps = new List<SLMeasureDimensionMap>();
            foreach (SLMeasureDimensionMap mdm in this.Maps)
            {
                pcd.Maps.Add(mdm.Clone());
            }

            return pcd;
        }
        internal SLPivotCacheDefinition Clone()
        {
            SLPivotCacheDefinition pcd = new SLPivotCacheDefinition();

            pcd.Id                    = this.Id;
            pcd.Invalid               = this.Invalid;
            pcd.SaveData              = this.SaveData;
            pcd.RefreshOnLoad         = this.RefreshOnLoad;
            pcd.OptimizeMemory        = this.OptimizeMemory;
            pcd.EnableRefresh         = this.EnableRefresh;
            pcd.RefreshedBy           = this.RefreshedBy;
            pcd.RefreshedDate         = this.RefreshedDate.Value;
            pcd.BackgroundQuery       = this.BackgroundQuery;
            pcd.MissingItemsLimit     = this.MissingItemsLimit.Value;
            pcd.CreatedVersion        = this.CreatedVersion;
            pcd.RefreshedVersion      = this.RefreshedVersion;
            pcd.MinRefreshableVersion = this.MinRefreshableVersion;
            pcd.RecordCount           = this.RecordCount.Value;
            pcd.UpgradeOnRefresh      = this.UpgradeOnRefresh;
            pcd.IsTupleCache          = this.IsTupleCache;
            pcd.SupportSubquery       = this.SupportSubquery;
            pcd.SupportAdvancedDrill  = this.SupportAdvancedDrill;

            pcd.CacheSource = this.CacheSource.Clone();

            pcd.CacheFields = new List <SLCacheField>();
            foreach (SLCacheField cf in this.CacheFields)
            {
                pcd.CacheFields.Add(cf.Clone());
            }

            pcd.CacheHierarchies = new List <SLCacheHierarchy>();
            foreach (SLCacheHierarchy ch in this.CacheHierarchies)
            {
                pcd.CacheHierarchies.Add(ch.Clone());
            }

            pcd.Kpis = new List <SLKpi>();
            foreach (SLKpi k in this.Kpis)
            {
                pcd.Kpis.Add(k.Clone());
            }

            pcd.HasTupleCache = this.HasTupleCache;
            pcd.TupleCache    = this.TupleCache.Clone();

            pcd.CalculatedItems = new List <SLCalculatedItem>();
            foreach (SLCalculatedItem ci in this.CalculatedItems)
            {
                pcd.CalculatedItems.Add(ci.Clone());
            }

            pcd.CalculatedMembers = new List <SLCalculatedMember>();
            foreach (SLCalculatedMember cm in this.CalculatedMembers)
            {
                pcd.CalculatedMembers.Add(cm.Clone());
            }

            pcd.Dimensions = new List <SLDimension>();
            foreach (SLDimension d in this.Dimensions)
            {
                pcd.Dimensions.Add(d.Clone());
            }

            pcd.MeasureGroups = new List <SLMeasureGroup>();
            foreach (SLMeasureGroup mg in this.MeasureGroups)
            {
                pcd.MeasureGroups.Add(mg.Clone());
            }

            pcd.Maps = new List <SLMeasureDimensionMap>();
            foreach (SLMeasureDimensionMap mdm in this.Maps)
            {
                pcd.Maps.Add(mdm.Clone());
            }

            return(pcd);
        }