Example #1
0
 private void Page_OnPreLoad(object sender, EventArgs e)
 {
     if (clearSessionOnNotIsPostBack && !Page.IsPostBack)
     {
         SessionWorker.RemoveObject();
         sessionWorker = null;
     }
 }
        protected void swReport_SessionWorkerInit(object sender, SessionWorkerArgs e)
        {
            Type type = null;

            if (webReportManager.Plugin != null && webReportManager.Plugin.Table != null)
            {
                type = webReportManager.Plugin.Table.DataSet.GetType();
            }
            var sessionWorker = new SessionWorker(Page, swReport.Key);
            var obj           = sessionWorker.Object;

            if (type == null)
            {
                sessionWorker.RemoveObject();
            }
            if (((obj != null && obj.GetType() != type) || obj == null) && type != null)
            {
                sessionWorker.Object = Activator.CreateInstance(type);
            }
            e.SessionWorker = sessionWorker;
        }