Exemplo n.º 1
0
        private RenderingInfoRoot Deserialize(AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.GetReportChunk getChunkCallback)
        {
            Stream stream = null;

            try
            {
                string text = default(string);
                stream = getChunkCallback(this.m_chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes.Other, out text);
                RenderingInfoRoot result = null;
                if (stream != null)
                {
                    BinaryFormatter bFormatter = new BinaryFormatter();
                    //result = (RenderingInfoRoot)bFormatter.Deserialize(stream);
                    //todo: can delete?
                    RevertImpersonationContext.Run(delegate
                    {
                        result = (RenderingInfoRoot)bFormatter.Deserialize(stream);
                    });
                }
                return(result);
            }
            catch (SerializationException)
            {
                return(null);
            }
            finally
            {
                if (stream != null)
                {
                    stream.Close();
                }
            }
        }
Exemplo n.º 2
0
 public RenderingInfoManager(string rendererID, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.GetReportChunk getChunkCallback, bool retrieveRenderingInfo)
 {
     this.m_chunkName = "RenderingInfo_" + rendererID;
     if (retrieveRenderingInfo)
     {
         this.m_renderingInfoRoot = this.Deserialize(getChunkCallback);
     }
     else
     {
         this.m_renderingInfoRoot = null;
     }
 }
Exemplo n.º 3
0
        private void Serialize(RenderingInfoRoot renderingInfoRoot, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.CreateReportChunk createChunkCallback)
        {
            Stream stream = null;

            try
            {
                stream = createChunkCallback(this.m_chunkName, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes.Other, null);
                if (stream != null)
                {
                    BinaryFormatter binaryFormatter = new BinaryFormatter();
                    binaryFormatter.Serialize(stream, renderingInfoRoot);
                }
            }
            finally
            {
                if (stream != null)
                {
                    stream.Close();
                }
            }
        }