internal static void AddObjectVisibilityRestrictionIfApplicable(AdomdConnection connection, string requestType, ListDictionary restrictions) { if (AdomdUtils.ShouldAddObjectVisibilityRestriction(connection)) { string text; if (requestType == DimensionCollectionInternal.schemaName) { text = "DIMENSION_VISIBILITY"; } else if (requestType == HierarchyCollectionInternal.schemaName) { text = "HIERARCHY_VISIBILITY"; } else if (requestType == LevelCollectionInternal.schemaName) { text = "LEVEL_VISIBILITY"; } else if (requestType == MeasureCollectionInternal.schemaName) { text = "MEASURE_VISIBILITY"; } else if (requestType == "MDSCHEMA_PROPERTIES") { text = "PROPERTY_VISIBILITY"; } else { text = null; } if (text != null) { restrictions.Add(text, 3); } } }
internal CubeMetadataCache(AdomdConnection connection, CubeDef parentCube) { this.msgDelegate = new AdomdUtils.GetInvalidatedMessageDelegate(this.GetCubesUpdatedMessage); this.connection = connection; this.parentCube = parentCube; this.cacheState = MetadataCacheState.UpToDate; this.cacheDataset = new DataSet(); this.cacheDataset.Locale = CultureInfo.InvariantCulture; this.restrictions = new ListDictionary(); this.restrictions.Add(CubeCollectionInternal.cubeNameRest, parentCube.Name); AdomdUtils.AddCubeSourceRestrictionIfApplicable(this.connection, this.restrictions); int count = CubeMetadataCache.internalTypeMap.Count; this.objectMetadataCaches = new ObjectMetadataCache[count]; bool flag = AdomdUtils.ShouldAddObjectVisibilityRestriction(this.connection); for (int i = 0; i < count; i++) { ListDictionary destinationRestrictions; if (flag || CubeMetadataCache.SchemaRowsetsData[i].HasAdditionalRestrictions) { destinationRestrictions = new ListDictionary(); AdomdUtils.CopyRestrictions(this.restrictions, destinationRestrictions); if (CubeMetadataCache.SchemaRowsetsData[i].HasAdditionalRestrictions) { CubeMetadataCache.AddSpecificRestrictions(CubeMetadataCache.SchemaRowsetsData[i], destinationRestrictions); } if (flag) { AdomdUtils.AddObjectVisibilityRestrictionIfApplicable(this.connection, CubeMetadataCache.SchemaRowsetsData[i].RequestType, destinationRestrictions); } } else { destinationRestrictions = this.restrictions; } this.objectMetadataCaches[i] = new ObjectMetadataCache(this, connection, CubeMetadataCache.SchemaRowsetsData[i], destinationRestrictions); } this.lastCacheValidationTime = parentCube.PopulatedTime; this.cubeInfoTable = new DataTable(); this.cubeInfoTable.Locale = CultureInfo.InvariantCulture; this.cubeInfoTable = ((DataRow)((IAdomdBaseObject)parentCube).MetadataData).Table.Clone(); this.originalTimeColumn = ((DataRow)((IAdomdBaseObject)parentCube).MetadataData).Table.Columns[CubeDef.lastSchemaUpdateColumn]; this.currentTimeColumn = this.cubeInfoTable.Columns[CubeDef.lastSchemaUpdateColumn]; }