Esempio n. 1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            if (Session.IsNewSession)
            {
                MapInfo.WebControls.MapControlModel controlModel = MapControlModel.SetDefaultModelInSession();

                // add custom commands to control model
                controlModel.Commands.Add(new CustomWebTools.Info());
                controlModel.Commands.Add(new CustomWebTools.ZoomValue());

                //instanciate AppStateManager class
                AppStateManager myStateManager = new AppStateManager();

                //put current map alias to state manager dictionary
                myStateManager.ParamsDictionary[StateManager.ActiveMapAliasKey] = this.MapControl1.MapAlias;

                //put state manager to session
                StateManager.PutStateManagerInSession(myStateManager);
            }



            // Now Restore State
            StateManager.GetStateManagerFromSession().RestoreState();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            if (Session.IsNewSession) {

                MapInfo.WebControls.MapControlModel controlModel = MapControlModel.SetDefaultModelInSession();

                // add custom commands to control model
                controlModel.Commands.Add(new CustomWebTools.Info());
                controlModel.Commands.Add(new CustomWebTools.ZoomValue());

                //instanciate AppStateManager class
                AppStateManager myStateManager = new AppStateManager();

                //put current map alias to state manager dictionary
                myStateManager.ParamsDictionary[StateManager.ActiveMapAliasKey] = this.MapControl1.MapAlias;

                //put state manager to session
                StateManager.PutStateManagerInSession(myStateManager);
            }

            // Now Restore State
            StateManager.GetStateManagerFromSession().RestoreState();
        }