コード例 #1
0
        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);
        }
コード例 #2
0
 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;
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 public Stream CreateChunk(AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string chunkName)
 {
     if (!this.IsChunkManagerValid())
     {
         return(null);
     }
     return(this.m_chunkManager.CreateChunk(type, chunkName));
 }
コード例 #5
0
 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));
 }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
 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);
 }
コード例 #9
0
        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);
        }
コード例 #10
0
        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));
            }
        }
コード例 #11
0
 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);
 }
コード例 #12
0
        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);
        }
コード例 #13
0
        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);
        }
コード例 #14
0
 public abstract Stream CreateChunk(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type, string mimeType);
コード例 #15
0
 public abstract string GetStreamMimeType(string name, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes type);
コード例 #16
0
 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();
     }
 }
コード例 #17
0
 private static IStreamHandler BuildChunkStreamHandler(string chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes chunkType, IChunkFactory chunkFactory, bool openExisting)
 {
     return(new ChunkFactoryStreamHandler(chunkName, chunkType, chunkFactory, openExisting));
 }
コード例 #18
0
 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);
 }