// for reconnection
 public IGAnswerConnected(HttpSessionState session)
     : base((IGConnectionLocal)null, (int)IGANSWER_ID.IGANSWER_WORKSPACE_CONNECTED, IGANSWERCONNECTED_STRING)
 {
     SetAttribute(IGANSWER_USERLOGIN, (string)session[DatabaseUserSecurityAuthority.IGMADAM_USERNAME]);
     SetAttribute(IGANSWER_REQGUID, (string)session[IGANSWER_REQGUID]);
     SetParameter(IGANSWER_USEROUTPUT, (string)session[IGANSWER_USEROUTPUT]);
     SetParameter(IGANSWER_IMAGELIBRARY, (string)session[IGANSWER_IMAGELIBRARY]);
     SetParameter(IGANSWER_RESTOREDFRAMEIDS, (string)session[IGANSWER_RESTOREDFRAMEIDS]);
     SetParameter(IGANSWER_SELECTEDFRAMEID, (string)session[IGANSWER_SELECTEDFRAMEID]);
     SetParameter(IGANSWER_FRAMENAMES, (string)session[IGANSWER_FRAMENAMES]);
     SetParameter(IGANSWER_REQGUIDS, (string)session[IGANSWER_REQGUIDS]);
     SetParameter(IGANSWER_SELECTEDREQGUID, (string)session[IGANSWER_SELECTEDREQGUID]);
     SetParameter(IGANSWER_ALLNBLAYERS, (string)session[IGANSWER_ALLNBLAYERS]);
     SetParameter(IGANSWER_ALLLAYERVISIBILITY, (string)session[IGANSWER_ALLLAYERVISIBILITY]);
     SetParameter(IGANSWER_ALLSTEPIDS, (string)session[IGANSWER_ALLSTEPIDS]);
     SetParameter(IGANSWER_WORKSPACEPROPERTIES, (string)session[IGANSWER_WORKSPACEPROPERTIES]);
     SetParameter(IGANSWER_FRAMEPROPERTIES, (string)session[IGANSWER_FRAMEPROPERTIES]);
     m_currentViewportMap = (IGViewportMap)session[IGANSWER_CURRENTVIEWPORTMAP];
 }
 public override void GetParams(HttpSessionState session)
 {
     List<string> lsFrameIds = new List<string>();
     splitParamToList(lsFrameIds, IGANSWER_RESTOREDFRAMEIDS);
     int nNbPictures = lsFrameIds.Count - 1;
     if (nNbPictures > 0)
     {
         string sSelFrameId = GetParameterValue(IGANSWER_SELECTEDFRAMEID);
         if ((sSelFrameId == null) || (sSelFrameId == ""))
             SetParameter(IGANSWER_SELECTEDFRAMEID, lsFrameIds[1]);
         string sFrameNames = GetParameterValue(IGANSWER_FRAMENAMES);
         string sFrameGuids = "";
         string sStepIds = "";
         if ((sFrameNames == null) || (sFrameNames == ""))
         {
             sFrameNames = "";
             int idxFrame = 1;
             for (; idxFrame < nNbPictures; idxFrame++)
             {
                 sFrameNames += "Recovered(" + idxFrame.ToString() + ").ig,";
                 sFrameGuids += GetReqGuid() + ",";
                 sStepIds += "1,";
             }
             sFrameNames += "Recovered(" + idxFrame.ToString() + ").ig";
             sFrameGuids += GetReqGuid();
             sStepIds += "1";
             SetParameter(IGANSWER_FRAMENAMES, sFrameNames);
             SetParameter(IGANSWER_REQGUIDS, sFrameGuids);
             SetParameter(IGANSWER_SELECTEDREQGUID, GetReqGuid());
             SetParameter(IGANSWER_ALLNBLAYERS, GetParameterValue(IGANSWER_ALLNBLAYERS));
             SetParameter(IGANSWER_ALLSTEPIDS, sStepIds);
         }
         if (session[IGANSWER_ALLNBLAYERS] != null)
             SetParameter(IGANSWER_ALLNBLAYERS, (string)session[IGANSWER_ALLNBLAYERS]);
         if (session[IGANSWER_ALLSTEPIDS] != null)
             SetParameter(IGANSWER_ALLSTEPIDS, (string)session[IGANSWER_ALLSTEPIDS]);
         List<string> lsNbLayers = new List<string>();
         splitParamToList(lsNbLayers, IGANSWER_ALLNBLAYERS);
         lsNbLayers.RemoveAt(0);
         string sAllLayerVisibility = "";
         for (int idxFrame = 0; idxFrame < nNbPictures; idxFrame++)
         {
             int nbLayers = int.Parse(lsNbLayers[idxFrame]);
             for (int idxLayer = 0; idxLayer < nbLayers; idxLayer++)
             {
                 sAllLayerVisibility += "1";
                 if (idxLayer < nbLayers - 1)
                     sAllLayerVisibility += "_";
             }
             if (idxFrame < nNbPictures - 1)
                 sAllLayerVisibility += ",";
         }
         SetParameter(IGANSWER_ALLLAYERVISIBILITY, sAllLayerVisibility);
     }
     if (session[IGANSWER_CURRENTVIEW] != null)
         SetParameter(IGANSWER_CURRENTVIEW, (string)session[IGANSWER_CURRENTVIEW]);
     if (session[IGANSWER_CURRENTVIEWPORTMAP] != null)
         m_currentViewportMap = (IGViewportMap)session[IGANSWER_CURRENTVIEWPORTMAP];
     else
     {
         m_currentViewportMap = new IGViewportMap();
         session[IGANSWER_CURRENTVIEWPORTMAP] = m_currentViewportMap;
     }
     string sImageLibrary = GetParameterValue(IGANSWER_IMAGELIBRARY);
     sImageLibrary = sImageLibrary.Replace(@"\\", @"/");
     sImageLibrary = sImageLibrary.Replace(@"\", @"/");
     session[IGANSWER_REQGUID] = GetReqGuid();
     session[IGANSWER_USEROUTPUT] = GetParameterValue(IGANSWER_USEROUTPUT);
     session[IGANSWER_IMAGELIBRARY] = sImageLibrary;
     session[IGANSWER_RESTOREDFRAMEIDS] = GetParameterValue(IGANSWER_RESTOREDFRAMEIDS);
     session[IGANSWER_SELECTEDFRAMEID] = GetParameterValue(IGANSWER_SELECTEDFRAMEID);
     session[IGANSWER_FRAMENAMES] = GetParameterValue(IGANSWER_FRAMENAMES);
     session[IGANSWER_REQGUIDS] = GetParameterValue(IGANSWER_REQGUIDS);
     session[IGANSWER_SELECTEDREQGUID] = GetParameterValue(IGANSWER_SELECTEDREQGUID);
     session[IGANSWER_ALLNBLAYERS] = GetParameterValue(IGANSWER_ALLNBLAYERS);
     session[IGANSWER_ALLLAYERVISIBILITY] = GetParameterValue(IGANSWER_ALLLAYERVISIBILITY);
     session[IGANSWER_ALLSTEPIDS] = GetParameterValue(IGANSWER_ALLSTEPIDS);
     // Workspace properties
     session[IGANSWER_WORKSPACEPROPERTIES] = GetParameterValue(IGANSWER_WORKSPACEPROPERTIES);
     // Frame properties
     session[IGANSWER_FRAMEPROPERTIES] = GetParameterValue(IGANSWER_FRAMEPROPERTIES);
 }