// When the session is not dirty these values are initial state of the session. private void SaveDefaultState(Map map) { HttpApplicationState application = HttpContext.Current.Application; if (application["DefaultZoom"] == null) { /* * byte[] bytes; * byte[] bytes2; * * bytes = ManualSerializer.BinaryStreamFromObject(MapInfo.Engine.Session.Current.Selections.DefaultSelection); * bytes2 = Arrays.Clone(bytes) as byte[]; * // Store default selection * application["DefaultSelection"] = bytes2; * * * bytes = ManualSerializer.BinaryStreamFromObject(map.Layers); * bytes2 = Arrays.Clone(bytes) as byte[]; * // Store default selection * application["DefaultLayers"] = bytes2;*/ // Store default selection application["DefaultSelection"] = ManualSerializer.BinaryStreamFromObject(MapInfo.Engine.Session.Current.Selections.DefaultSelection); // Store layers collection application["DefaultLayers"] = ManualSerializer.BinaryStreamFromObject(map.Layers); // Store the original zoom and center. application["DefaultCenter"] = map.Center; application["DefaultZoom"] = map.Zoom; } // This MapXtreme object should be marked as dirty MapInfo.Engine.Session.Current.CustomProperties["DirtyFlag"] = true; //HttpContext.Current.Response.Write("<br><br><br><br><br><br><br><br><br><br>SaveDefaultState"); //HttpContext.Current.Response.End(); }
// When the session is not dirty these values are initial state of the session. private void SaveDefaultState(Map map) { HttpApplicationState application = HttpContext.Current.Application; if (application["Zoom"] == null) { // Store default selection application["Selection"] = ManualSerializer.BinaryStreamFromObject(MapInfo.Engine.Session.Current.Selections.DefaultSelection); // Store layers collection application["Layers"] = ManualSerializer.BinaryStreamFromObject(map.Layers); // Store the original zoom and center. application["Center"] = map.Center; application["Zoom"] = map.Zoom; } }
// When the session is not dirty these values are initial state of the session. private void SaveDefaultState(Map map) { HttpApplicationState application = HttpContext.Current.Application; if (application["DefaultZoom"] == null) { // Store default selection application["DefaultSelection"] = ManualSerializer.BinaryStreamFromObject(MapInfo.Engine.Session.Current.Selections.DefaultSelection); // Store layers collection application["DefaultLayers"] = ManualSerializer.BinaryStreamFromObject(map.Layers); // Store the original zoom and center. application["DefaultCenter"] = map.Center; application["DefaultZoom"] = map.Zoom; } // Set the dirty flag in this MapXtreme Session Instance MapInfo.Engine.Session.Current.CustomProperties.Add("Dirty", true); }
// When the MapXtreme Session is not dirty save the initial state of this session read from the // initial workspace from the web.config. private void SaveDefaultState(Map map) { HttpApplicationState application = HttpContext.Current.Application; if (application["DefaultZoom"] == null) { // Store default selection application["DefaultSelection"] = ManualSerializer.BinaryStreamFromObject(MapInfo.Engine.Session.Current.Selections.DefaultSelection); // Store layers collection application["DefaultLayers"] = ManualSerializer.BinaryStreamFromObject(map.Layers); // Store the original zoom and center. application["DefaultCenter"] = map.Center; application["DefaultZoom"] = map.Zoom; } // This pooled MapXtreme Session instance should be marked as dirty MapInfo.Engine.Session.Current.CustomProperties["DirtyFlag"] = true; }