public Stream GetOrCreateChunk(AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string chunkName, bool createChunkIfNotExists, out bool isNewChunk) { isNewChunk = false; if (chunkName == null) { throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidParameterValue, "chunkName"); } if (this.m_chunks.ContainsKey(chunkName)) { return(this.m_chunks[chunkName]); } string text = default(string); Stream stream = this.m_chunkFactory.GetChunk(chunkName, type, ChunkMode.Open, out text); if (createChunkIfNotExists && stream == null) { stream = this.m_chunkFactory.CreateChunk(chunkName, type, null); isNewChunk = true; } if (stream != null) { this.m_chunks.Add(chunkName, stream); } return(stream); }
public ChunkFactoryStreamHandler(string chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes chunkType, IChunkFactory chunkFactory, bool existingChunk) { this.m_chunkName = chunkName; this.m_chunkType = chunkType; this.m_chunkFactory = chunkFactory; this.m_existingChunk = existingChunk; }
public override Stream CreateChunk(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string mimeType) { this.Erase(name, type); Chunk chunk = new Chunk(mimeType, name, type); this.m_allChunks.Add(chunk); return(chunk.Stream); }
public Stream CreateChunk(AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string chunkName) { if (!this.IsChunkManagerValid()) { return(null); } return(this.m_chunkManager.CreateChunk(type, chunkName)); }
public Stream GetOrCreateChunk(AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string chunkName, bool createChunkIfNotExists, out bool isNewChunk) { if (!this.IsChunkManagerValid()) { isNewChunk = false; return(null); } return(this.m_chunkManager.GetOrCreateChunk(type, chunkName, createChunkIfNotExists, out isNewChunk)); }
public override string GetStreamMimeType(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type) { Chunk chunkImpl = this.GetChunkImpl(name, type); if (chunkImpl == null) { return(null); } return(chunkImpl.Header.MimeType); }
public static string StoreImageDataInChunk(AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes chunkType, byte[] imageData, string mimeType, OnDemandMetadata odpMetadata, IChunkFactory chunkFactory) { string text = ImageHelper.GenerateImageStreamName(); ReportSnapshot reportSnapshot = odpMetadata.ReportSnapshot; using (Stream stream = chunkFactory.CreateChunk(text, chunkType, mimeType)) { stream.Write(imageData, 0, imageData.Length); return(text); } }
private Chunk GetChunkImpl(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type) { foreach (Chunk allChunk in this.m_allChunks) { if (allChunk.Header.ChunkName == name && allChunk.Header.ChunkType == (int)type) { return(allChunk); } } return(null); }
public Stream GetChunk(string chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes chunkType, ChunkMode chunkMode, out string mimeType) { Stream stream = ((SnapshotBase)this).GetChunk(chunkName, chunkType, out mimeType); if (chunkMode == ChunkMode.OpenOrCreate && stream == null) { mimeType = null; stream = this.CreateChunk(chunkName, chunkType, mimeType); } return(stream); }
private byte[] ReadImageDataFromChunk(string chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes chunkType) { byte[] array = null; string text = default(string); Stream chunk = base.m_chunkFactory.GetChunk(chunkName, chunkType, ChunkMode.Open, out text); Global.Tracer.Assert(chunk != null, "Could not find expected image data chunk. Name='{0}', Type={1}", chunkName, chunkType); using (chunk) { return(StreamSupport.ReadToEndUsingLength(chunk)); } }
public bool Erase(string chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type) { foreach (Chunk allChunk in this.m_allChunks) { if (allChunk.Header.ChunkName == chunkName && allChunk.Header.ChunkType == (int)type) { this.m_allChunks.Remove(allChunk); return(true); } } return(false); }
public override Stream GetChunk(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, out string mimeType) { Chunk chunkImpl = this.GetChunkImpl(name, type); if (chunkImpl == null) { mimeType = null; return(null); } mimeType = chunkImpl.Header.MimeType; chunkImpl.Stream.Seek(0L, SeekOrigin.Begin); if (chunkImpl.Header.ChunkFlag == ChunkFlags.Compressed) { throw new InternalCatalogException("Cannot read compressed chunk."); } return(chunkImpl.Stream); }
public Stream CreateChunk(AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string chunkName) { if (chunkName == null) { throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidParameterValue, "chunkName"); } Stream stream = default(Stream); if (this.m_chunks.TryGetValue(chunkName, out stream)) { stream.Close(); this.m_chunks.Remove(chunkName); } stream = this.m_chunkFactory.CreateChunk(chunkName, type, null); if (stream != null) { this.m_chunks.Add(chunkName, stream); } return(stream); }
public abstract Stream CreateChunk(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string mimeType);
public abstract string GetStreamMimeType(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type);
private static void PreparePartitionedTreeForAsyncSerialization(PartitionedTreeScalabilityCache scaleCache, OnDemandProcessingContext odpContext, string chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes chunkType) { if (scaleCache != null) { RIFAppendOnlyStorage rIFAppendOnlyStorage = scaleCache.Storage as RIFAppendOnlyStorage; if (rIFAppendOnlyStorage != null) { IStreamHandler streamHandler = OnDemandProcessingManager.BuildChunkStreamHandler(chunkName, chunkType, odpContext.ChunkFactory, rIFAppendOnlyStorage.FromExistingStream); rIFAppendOnlyStorage.Reset(streamHandler); } scaleCache.PrepareForFlush(); } }
private static IStreamHandler BuildChunkStreamHandler(string chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes chunkType, IChunkFactory chunkFactory, bool openExisting) { return(new ChunkFactoryStreamHandler(chunkName, chunkType, chunkFactory, openExisting)); }
public Chunk(string mimeType, string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type) { this.m_header = new ChunkHeader(name, (int)type, ChunkFlags.None, mimeType, ChunkHeader.CurrentVersion, 0L); }