public void ReadXML(MashupParseContext context) { XMLTagReader xMLTagReader = context.NewTagReader("MapGrinderMashupFile"); context.version = MashupXMLSchemaVersion.ReadXMLAttribute(context.reader); SingleMaxZoomForEntireMashupCompatibilityBlob singleMaxZoomForEntireMashupCompatibilityBlob = null; string text = null; while (xMLTagReader.FindNextStartTag()) { if (context.version != MonolithicMapPositionsSchema.schema && xMLTagReader.TagIs(LayerList.GetXMLTag())) { this._layerList = new LayerList(context, new SourceMap.GetFilenameContext(this.GetFilenameContext), this.dirtyEvent, this.readyToLockEvent); } else { if (context.version == MonolithicMapPositionsSchema.schema && xMLTagReader.TagIs(SourceMap.GetXMLTag())) { if (this._layerList != null && this._layerList.Count > 0) { throw new InvalidMashupFile(context, string.Format("Multiple SourceMaps in Version {0} file.", context.version.versionNumberString)); } SourceMap sourceMap = new SourceMap(context, new SourceMap.GetFilenameContext(this.GetFilenameContext), this.dirtyEvent, this.readyToLockEvent); this._layerList = new LayerList(this.dirtyEvent); this._layerList.AddNewLayer(); this._layerList.First.Add(sourceMap); } else { if (xMLTagReader.TagIs(RenderOptions.GetXMLTag())) { this.renderOptions = new RenderOptions(context, this.dirtyEvent, ref singleMaxZoomForEntireMashupCompatibilityBlob); } else { if (xMLTagReader.TagIs(Mashup.LastViewTag)) { XMLTagReader xMLTagReader2 = context.NewTagReader(Mashup.LastViewTag); text = context.reader.GetAttribute(Mashup.LastView_TargetIdAttr); xMLTagReader2.SkipAllSubTags(); } } } } } this._lastView = new NoView(); if (text != null) { object obj = context.FetchObjectByIdentity(text); if (obj != null && obj is LastViewIfc) { this._lastView = ((LastViewIfc)obj).lastView; } } if (this.renderOptions == null) { if (context.version != MonolithicMapPositionsSchema.schema) { context.warnings.Add(new MashupFileWarning("RenderOptions tag absent.")); } this.renderOptions = new RenderOptions(this.dirtyEvent); } if (singleMaxZoomForEntireMashupCompatibilityBlob != null) { D.Assert(context.version == SingleMaxZoomForEntireMashupSchema.schema); foreach (Layer current in this._layerList) { foreach (SourceMap current2 in current) { current2.sourceMapRenderOptions.maxZoom = singleMaxZoomForEntireMashupCompatibilityBlob.maxZoom; } } } }
public Mashup() { this.dirtyEvent.Add(new DirtyListener(this.SetDirtyFlag)); this._layerList = new LayerList(this.dirtyEvent); this.renderOptions = new RenderOptions(this.dirtyEvent); }
public Layer(LayerList otherLayers, DirtyEvent parentDirty) { this.dirtyEvent = new DirtyEvent(parentDirty); int num = 1; string text = "New Layer"; while (otherLayers.HasLayerNamed(text)) { num++; text = string.Format("{0} {1}", "New Layer", num); } this._displayName = text; }