예제 #1
0
        private RenderingInfoRoot Deserialize(Microsoft.ReportingServices.ReportProcessing.ReportProcessing.GetReportChunk getChunkCallback)
        {
            Stream stream = null;

            try
            {
                stream = getChunkCallback(m_chunkName, Microsoft.ReportingServices.ReportProcessing.ReportProcessing.ReportChunkTypes.Other, out string _);
                RenderingInfoRoot result = null;
                if (stream != null)
                {
                    BinaryFormatter bFormatter = new BinaryFormatter();
                    RevertImpersonationContext.Run(delegate
                    {
                        result = (RenderingInfoRoot)bFormatter.Deserialize(stream);
                    });
                }
                return(result);
            }
            catch (SerializationException)
            {
                return(null);
            }
            finally
            {
                if (stream != null)
                {
                    stream.Close();
                }
            }
        }
예제 #2
0
 internal RenderingInfoManager(string rendererID, Microsoft.ReportingServices.ReportProcessing.ReportProcessing.GetReportChunk getChunkCallback, bool retrieveRenderingInfo)
 {
     m_chunkName = "RenderingInfo_" + rendererID;
     if (retrieveRenderingInfo)
     {
         m_renderingInfoRoot = Deserialize(getChunkCallback);
     }
     else
     {
         m_renderingInfoRoot = null;
     }
 }
예제 #3
0
        private void Serialize(RenderingInfoRoot renderingInfoRoot, Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateReportChunk createChunkCallback)
        {
            Stream stream = null;

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