Example #1
0
 public void WriteXML(MashupWriteContext wc)
 {
     wc.writer.WriteStartElement(RenderClip.GetXMLTag());
     if (this._rect != null)
     {
         this._rect.WriteXML(wc.writer);
     }
     wc.writer.WriteEndElement();
 }
Example #2
0
        public RenderClip(MashupParseContext context)
        {
            XMLTagReader xMLTagReader = context.NewTagReader(RenderClip.GetXMLTag());

            while (xMLTagReader.FindNextStartTag())
            {
                if (xMLTagReader.TagIs(MapRectangle.GetXMLTag()))
                {
                    context.AssertUnique(this._rect);
                    this._rect = new MapRectangle(context, MercatorCoordinateSystem.theInstance);
                }
            }
        }
Example #3
0
        public Layer(MashupParseContext context, SourceMap.GetFilenameContext filenameContextDelegate,
                     DirtyEvent parentDirty, DirtyEvent parentReadyToLockEvent)
        {
            dirtyEvent = new DirtyEvent(parentDirty);
            XMLTagReader xMLTagReader = context.NewTagReader("Layer");

            context.ExpectIdentity(this);
            string attribute = context.reader.GetAttribute("DisplayName");

            if (attribute != null)
            {
                _displayName = attribute;
                context.GetAttributeBoolean("Expanded", ref _expanded);
                string attribute2 = context.reader.GetAttribute("SimulateTransparencyWithVEBackingLayer");
                if (attribute2 != null)
                {
                    _simulateTransparencyWithVEBackingLayer = attribute2;
                }

                while (xMLTagReader.FindNextStartTag())
                {
                    if (xMLTagReader.TagIs(SourceMap.GetXMLTag()))
                    {
                        Add(new SourceMap(context,
                                          filenameContextDelegate,
                                          dirtyEvent,
                                          parentReadyToLockEvent));
                    }
                    else
                    {
                        if (xMLTagReader.TagIs(LayerView.GetXMLTag()))
                        {
                            _lastView = new LayerView(this, context);
                        }
                        else
                        {
                            if (xMLTagReader.TagIs("LastLayerViewPosition"))
                            {
                                XMLTagReader xMLTagReader2 = context.NewTagReader("LastLayerViewPosition");
                                MapPosition  mapPosition   = null;
                                while (xMLTagReader2.FindNextStartTag())
                                {
                                    if (xMLTagReader2.TagIs(MapPosition.GetXMLTag(context.version)))
                                    {
                                        mapPosition = new MapPosition(context,
                                                                      null,
                                                                      MercatorCoordinateSystem.theInstance);
                                    }
                                }

                                if (mapPosition != null)
                                {
                                    _lastView = new LayerView(this, mapPosition);
                                }
                            }
                            else
                            {
                                if (xMLTagReader.TagIs(RenderClip.GetXMLTag()))
                                {
                                    _renderClip = new RenderClip(context);
                                }
                            }
                        }
                    }
                }

                return;
            }

            throw new InvalidMashupFile(context, "Expected displayName attribute");
        }