protected virtual void DefaultDrawingELayerToXml(XElement root) { IGraphicsLayer gLayer = DefaultDrawingELayer.GraphicsLayer; IGraphicCollection gc = IS3Runtime.GraphicEngine.NewGraphicCollection(); foreach (IGraphic g in gLayer.Graphics) { gc.Add(g); } XElement parent = new XElement("DefaultDrawingELayer"); XElement node = GraphicsSerializer.GraphicsToXml(gc); parent.Add(node); root.Add(parent); }
protected virtual void DefaultDrawingELayerFromXml(XElement root) { XElement parent = root.Descendants().First(); if (parent.Name != "DefaultDrawingELayer") { return; } XElement node = parent.Descendants().First(); IGraphicCollection graphics = GraphicsSerializer.GraphicsFromXml(node); if (graphics == null) { return; } IGraphicsLayer gLayer = DefaultDrawingELayer.GraphicsLayer; _view.AddGraphics(gLayer, graphics); }