internal CacheSource ToCacheSource() { var cs = new CacheSource(); cs.Type = Type; if (ConnectionId != 0) { cs.ConnectionId = ConnectionId; } if (IsWorksheetSource != null) { if (IsWorksheetSource.Value) { cs.WorksheetSource = new WorksheetSource(); if ((WorksheetSourceReference != null) && (WorksheetSourceReference.Length > 0)) { cs.WorksheetSource.Reference = WorksheetSourceReference; } if ((WorksheetSourceName != null) && (WorksheetSourceName.Length > 0)) { cs.WorksheetSource.Name = WorksheetSourceName; } if ((WorksheetSourceSheet != null) && (WorksheetSourceSheet.Length > 0)) { cs.WorksheetSource.Sheet = WorksheetSourceSheet; } if ((WorksheetSourceId != null) && (WorksheetSourceId.Length > 0)) { cs.WorksheetSource.Id = WorksheetSourceId; } } else { cs.Consolidation = Consolidation.ToConsolidation(); } } else { if (ExtensionList != null) { cs.CacheSourceExtensionList = (CacheSourceExtensionList)ExtensionList.CloneNode(true); } } return(cs); }
internal SLCacheSource Clone() { var cs = new SLCacheSource(); cs.Type = Type; cs.ConnectionId = ConnectionId; cs.IsWorksheetSource = IsWorksheetSource; cs.WorksheetSourceReference = WorksheetSourceReference; cs.WorksheetSourceName = WorksheetSourceName; cs.WorksheetSourceSheet = WorksheetSourceSheet; cs.WorksheetSourceId = WorksheetSourceId; cs.Consolidation = Consolidation.Clone(); if (ExtensionList != null) { cs.ExtensionList = (CacheSourceExtensionList)ExtensionList.CloneNode(true); } return(cs); }