public SourceMapRegistrationView(SourceMap sourceMap, LatLonZoom sourceMapView, MapPosition referenceMapView) { this._sourceMap = sourceMap; this._locked = false; this.sourceMapView = sourceMapView; this.referenceMapView = new MapPosition(referenceMapView, null); }
public void setPosition(MapPosition p) { if (p.IsValid()) { this.setPosition(p.llz, p.style); } }
public SourceMapRegistrationView(SourceMap sourceMap, MapPosition lockedMapView) { this._sourceMap = sourceMap; this._locked = true; this.referenceMapView = new MapPosition(lockedMapView, null); this.sourceMapView = lockedMapView.llz; }
public LegendView(Legend legend, bool showingPreview, LatLonZoom sourceMapView, MapPosition referenceMapView) { this._legend = legend; this._showingPreview = showingPreview; this.sourceMapView = sourceMapView; this.referenceMapView = referenceMapView; }
public MapPosition(MapPosition prototype, PositionUpdateIfc updateIfc) { this._llz = prototype._llz; this._style = prototype._style; this.valid = prototype.valid; this.updateIfc = updateIfc; }
public UIPositionManager(ViewerControl smViewer, ViewerControl veViewer) { this._smPos = new MapPosition(this); this._vePos = new MapPosition(this); smViewer.Initialize(new MapPositionDelegate(this.GetSMPos), "Source Map Position"); veViewer.Initialize(new MapPositionDelegate(this.GetVEPos), "Virtual Earth Position"); this.smUpdate = smViewer; this.veUpdate = veViewer; this.slaved = false; }
public DisplayablePosition(MashupParseContext context, CoordinateSystemIfc coordSys) { if (context.version == MonolithicMapPositionsSchema.schema) { MapPosition mapPosition = new MapPosition(context, null, coordSys); this._pinPosition = mapPosition.llz; return; } this._pinPosition = new LatLonZoom(context, coordSys); }
public RenderedMashupViewer(CachePackage cachePackage, ToolStripMenuItem dmsMenuItem) { this.InitializeComponent(); this.cachePackage = cachePackage; this.mapPos = new MapPosition(this.viewer); this.viewer.Initialize(new MapPositionDelegate(this.GetMapPos), "Map Location"); this.viewer.ShowDMS = new MapDrawingOption(this.viewer, dmsMenuItem, false); this.SetVEMapStyle(VirtualEarthWebDownloader.RoadStyle); this.mapPos.setPosition(this.viewer.GetCoordinateSystem().GetDefaultView()); this.printDoc = new PrintDocument(); this.printDoc.PrintPage += new PrintPageEventHandler(this.PrintPage); }
public void switchSlaved() { this.slaved = true; if (this._vePos != null) { this.slavedPos = new MapPosition(this._vePos, this); } else { this.slavedPos = new MapPosition(this); } this._smPos = null; this._vePos = null; this.UpdatePositions(); }
public void switchFree() { this.slaved = false; MapPosition prototype; if (this.slavedPos != null) { prototype = this.slavedPos; } else { prototype = new MapPosition(null); } this._vePos = new MapPosition(prototype, this); this._smPos = new MapPosition(prototype, this); this.slavedPos = null; this.UpdatePositions(); }
public LayerView(Layer layer, MashupParseContext context) { this._layer = layer; bool flag = false; XMLTagReader xMLTagReader = context.NewTagReader(LayerView.GetXMLTag()); while (xMLTagReader.FindNextStartTag()) { if (xMLTagReader.TagIs(MapPosition.GetXMLTag(context.version))) { this.lockedView = new MapPosition(context, null, MercatorCoordinateSystem.theInstance); flag = true; } } if (!flag) { throw new InvalidMashupFile(context, "No LatLonZoom tag in LayerView."); } }
public SourceMapRegistrationView(SourceMap sourceMap, MashupParseContext context) { this._sourceMap = sourceMap; XMLTagReader xMLTagReader = context.NewTagReader(SourceMapRegistrationView.GetXMLTag()); this._locked = context.GetRequiredAttributeBoolean(SourceMapRegistrationView.lockedAttribute); bool flag = false; while (xMLTagReader.FindNextStartTag()) { if (xMLTagReader.TagIs(SourceMapRegistrationView.sourceMapViewTag)) { XMLTagReader xMLTagReader2 = context.NewTagReader(SourceMapRegistrationView.sourceMapViewTag); while (xMLTagReader2.FindNextStartTag()) { if (xMLTagReader2.TagIs(LatLonZoom.GetXMLTag())) { this.sourceMapView = new LatLonZoom(context, ContinuousCoordinateSystem.theInstance); flag = true; } } } else { if (xMLTagReader.TagIs(SourceMapRegistrationView.referenceMapViewTag)) { XMLTagReader xMLTagReader3 = context.NewTagReader(SourceMapRegistrationView.referenceMapViewTag); while (xMLTagReader3.FindNextStartTag()) { if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version))) { this.referenceMapView = new MapPosition(context, null, MercatorCoordinateSystem.theInstance); } } } } } if (this.referenceMapView == null) { throw new InvalidMashupFile(context, "No " + SourceMapRegistrationView.referenceMapViewTag + " tag in LayerView."); } if (flag == this._locked) { throw new InvalidMashupFile(context, "locked flag disagrees with " + SourceMapRegistrationView.sourceMapViewTag + " element."); } }
public LegendView(Legend legend, MashupParseContext context) { this._legend = legend; object obj = null; XMLTagReader xMLTagReader = context.NewTagReader(LegendView.GetXMLTag()); this._showingPreview = context.GetRequiredAttributeBoolean(LegendView.previewAttr); while (xMLTagReader.FindNextStartTag()) { if (xMLTagReader.TagIs(LegendView.sourceMapViewTag)) { XMLTagReader xMLTagReader2 = context.NewTagReader(LegendView.sourceMapViewTag); while (xMLTagReader2.FindNextStartTag()) { if (xMLTagReader2.TagIs(LatLonZoom.GetXMLTag())) { this.sourceMapView = new LatLonZoom(context, ContinuousCoordinateSystem.theInstance); context.AssertUnique(obj); obj = new object(); } } } else { if (xMLTagReader.TagIs(LegendView.referenceMapViewTag)) { context.AssertUnique(this.referenceMapView); XMLTagReader xMLTagReader3 = context.NewTagReader(LegendView.referenceMapViewTag); while (xMLTagReader3.FindNextStartTag()) { if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version))) { this.referenceMapView = new MapPosition(context, null, MercatorCoordinateSystem.theInstance); } } } } } context.AssertPresent(obj, LegendView.sourceMapViewTag); context.AssertPresent(this.referenceMapView, LegendView.referenceMapViewTag); }
public SourceMap(MashupParseContext context, SourceMap.GetFilenameContext filenameContextDelegate, DirtyEvent parentDirty, DirtyEvent parentReadyToLockEvent) { this.dirtyEvent = new DirtyEvent(parentDirty); this.readyToLockChangedEvent = new DirtyEvent(parentReadyToLockEvent); this.filenameContextDelegate = filenameContextDelegate; this.latentRegionHolder = new LatentRegionHolder(this.dirtyEvent, this.readyToLockChangedEvent); XMLTagReader xMLTagReader = context.NewTagReader("SourceMap"); context.ExpectIdentity(this); string attribute = context.reader.GetAttribute("SourceMapFilename"); if (attribute != null) { string path = Path.Combine(filenameContextDelegate(), attribute); int pageNumber = 0; context.GetAttributeInt("PageNumber", ref pageNumber); this._documentFuture = new GeneralDocumentFuture(new FutureDocumentFromFilesystem(path, pageNumber)); } context.GetAttributeBoolean("Expanded", ref this._expanded); string attribute2 = context.reader.GetAttribute("DisplayName"); MapPosition mapPosition = null; MapPosition mapPosition2 = null; while (xMLTagReader.FindNextStartTag()) { if (xMLTagReader.TagIs(RegistrationDefinition.GetXMLTag())) { context.AssertUnique(this.registration); this.registration = new RegistrationDefinition(context, this.dirtyEvent); } else { if (xMLTagReader.TagIs(GeneralDocumentFuture.GetXMLTag())) { context.AssertUnique(this._documentFuture); this._documentFuture = new GeneralDocumentFuture(context, filenameContextDelegate()); } else { if (xMLTagReader.TagIs(LocalDocumentDescriptor.GetXMLTag())) { context.AssertUnique(this._documentFuture); LocalDocumentDescriptor localDocumentDescriptor = new LocalDocumentDescriptor(context, filenameContextDelegate()); this._documentFuture = new GeneralDocumentFuture(new FutureDocumentFromFilesystem(localDocumentDescriptor.GetFilesystemAbsolutePath(), localDocumentDescriptor.GetPageNumber())); } else { if (xMLTagReader.TagIs("LastSourceMapPosition")) { XMLTagReader xMLTagReader2 = context.NewTagReader("LastSourceMapPosition"); while (xMLTagReader2.FindNextStartTag()) { if (xMLTagReader2.TagIs(MapPosition.GetXMLTag(context.version))) { mapPosition = new MapPosition(context, null, ContinuousCoordinateSystem.theInstance); } } } else { if (xMLTagReader.TagIs("LastVEPosition")) { XMLTagReader xMLTagReader3 = context.NewTagReader("LastVEPosition"); while (xMLTagReader3.FindNextStartTag()) { if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version))) { mapPosition2 = new MapPosition(context, null, MercatorCoordinateSystem.theInstance); } } } else { if (xMLTagReader.TagIs(RenderRegion.GetXMLTag())) { context.AssertUnique(this.renderRegion); this.renderRegion = new RenderRegion(context, this.dirtyEvent, ContinuousCoordinateSystem.theInstance); } else { if (xMLTagReader.TagIs(SourceMapInfo.GetXMLTag())) { context.AssertUnique(this._sourceMapInfo); this._sourceMapInfo = new SourceMapInfo(context, this.dirtyEvent); } else { if (xMLTagReader.TagIs(SourceMapRenderOptions.GetXMLTag())) { context.AssertUnique(this._sourceMapRenderOptions); this._sourceMapRenderOptions = new SourceMapRenderOptions(context, this.dirtyEvent); } else { if (xMLTagReader.TagIs(TransparencyOptions.GetXMLTag())) { this._transparencyOptions = new TransparencyOptions(context, this.dirtyEvent); } else { if (xMLTagReader.TagIs(SourceMapRegistrationView.GetXMLTag())) { context.AssertUnique(this._lastView); this._lastView = new SourceMapRegistrationView(this, context); } else { if (xMLTagReader.TagIs(LegendList.GetXMLTag())) { context.AssertUnique(this.legendList); this.legendList = new LegendList(this, context, this.dirtyEvent); } else { if (xMLTagReader.TagIs("SnapView")) { XMLTagReader xMLTagReader4 = context.NewTagReader("SnapView"); string requiredAttribute = context.GetRequiredAttribute("Context"); LatLonZoom latLonZoom = default(LatLonZoom); bool flag = false; bool flag2 = true; CoordinateSystemIfc coordSys = null; if (requiredAttribute == "Source") { coordSys = ContinuousCoordinateSystem.theInstance; } else { if (!(requiredAttribute == "Reference")) { throw new InvalidMashupFile(context, string.Format("Invalid {0} value {1}", "Context", requiredAttribute)); } coordSys = MercatorCoordinateSystem.theInstance; } while (xMLTagReader4.FindNextStartTag()) { if (xMLTagReader4.TagIs(LatLonZoom.GetXMLTag())) { if (flag) { context.ThrowUnique(); } try { latLonZoom = new LatLonZoom(context, coordSys); } catch (InvalidLLZ) { flag2 = false; } flag = true; } } if (flag2) { if (!flag) { context.AssertPresent(null, LatLonZoom.GetXMLTag()); } if (requiredAttribute == "Source") { this.sourceSnap = latLonZoom; } else { if (requiredAttribute == "Reference") { this.referenceSnap = latLonZoom; } else { D.Assert(false, "handled above."); } } } } else { if (xMLTagReader.TagIs("SnapZoom")) { context.NewTagReader("SnapZoom"); string requiredAttribute2 = context.GetRequiredAttribute("Context"); bool flag3 = false; CoordinateSystemIfc theInstance; if (requiredAttribute2 == "Source") { theInstance = ContinuousCoordinateSystem.theInstance; } else { if (!(requiredAttribute2 == "Reference")) { throw new InvalidMashupFile(context, string.Format("Invalid {0} value {1}", "Context", requiredAttribute2)); } theInstance = MercatorCoordinateSystem.theInstance; } int num = 0; try { theInstance.GetZoomRange().Parse(context, "Zoom"); flag3 = true; } catch (InvalidMashupFile) { } if (flag3) { if (requiredAttribute2 == "Source") { this.sourceSnapZoom = num; } else { if (requiredAttribute2 == "Reference") { this.referenceSnapZoom = num; } } } } } } } } } } } } } } } } if (context.version == InlineSourceMapInfoSchema.schema) { if (xMLTagReader.TagIs("MapFileURL")) { this._sourceMapInfo.mapFileURL = XMLUtils.ReadStringXml(context, "MapFileURL"); } else { if (xMLTagReader.TagIs("MapHomePage")) { this._sourceMapInfo.mapHomePage = XMLUtils.ReadStringXml(context, "MapHomePage"); } else { if (xMLTagReader.TagIs("MapDescription")) { this._sourceMapInfo.mapDescription = XMLUtils.ReadStringXml(context, "MapDescription"); } } } } } if (attribute2 != null) { this._displayName = attribute2; } else { this._displayName = this._documentFuture.documentFuture.GetDefaultDisplayName(); } if (this._lastView == null && mapPosition != null && mapPosition2 != null) { this._lastView = new SourceMapRegistrationView(this, mapPosition.llz, mapPosition2); } if (this._documentFuture == null) { throw new Exception("Source Map element missing document descriptor tag"); } if (this.registration == null) { this.registration = new RegistrationDefinition(this.dirtyEvent); } this.registration.dirtyEvent.Add(this.readyToLockChangedEvent); if (this.legendList == null) { this.legendList = new LegendList(this, this.dirtyEvent, this.readyToLockChangedEvent); } if (this._sourceMapInfo == null) { this._sourceMapInfo = new SourceMapInfo(this.dirtyEvent); } if (this._sourceMapRenderOptions == null) { this._sourceMapRenderOptions = new SourceMapRenderOptions(this.dirtyEvent); } if (this._transparencyOptions == null) { this._transparencyOptions = new TransparencyOptions(this.dirtyEvent); } }
public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition) { this._lastView = new SourceMapRegistrationView(this, sourceMapPosition, referenceMapPosition); }
public void NotePositionLocked(MapPosition referenceMapPosition) { this._lastView = new SourceMapRegistrationView(this, referenceMapPosition); }
public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition) { bool showingPreview = false; this._lastView = new LegendView(this, showingPreview, sourceMapPosition, referenceMapPosition); }
public LayerView(Layer layer, MapPosition lockedView) { this._layer = layer; this.lockedView = lockedView; }
public void NotePositionLocked(MapPosition referenceMapPosition) { D.Assert(false, "legend view never locked"); }
public void NotePositionLocked(MapPosition referenceMapPosition) { this._lastView = new LayerView(this, referenceMapPosition); }
public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition) { D.Assert(false, "Layers are never unlocked."); }
public SourceMapOverviewWindow() { this.InitializeComponent(); this.mapPos = new MapPosition(this.viewerControl); this.viewerControl.Initialize(new MapPositionDelegate(this.GetMapPos), "Overview"); }
public Layer(MashupParseContext context, SourceMap.GetFilenameContext filenameContextDelegate, DirtyEvent parentDirty, DirtyEvent parentReadyToLockEvent) { this.dirtyEvent = new DirtyEvent(parentDirty); XMLTagReader xMLTagReader = context.NewTagReader("Layer"); context.ExpectIdentity(this); string attribute = context.reader.GetAttribute("DisplayName"); if (attribute != null) { this._displayName = attribute; context.GetAttributeBoolean("Expanded", ref this._expanded); string attribute2 = context.reader.GetAttribute("SimulateTransparencyWithVEBackingLayer"); if (attribute2 != null) { this._simulateTransparencyWithVEBackingLayer = attribute2; } while (xMLTagReader.FindNextStartTag()) { if (xMLTagReader.TagIs(SourceMap.GetXMLTag())) { this.Add(new SourceMap(context, filenameContextDelegate, this.dirtyEvent, parentReadyToLockEvent)); } else { if (xMLTagReader.TagIs(LayerView.GetXMLTag())) { this._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) { this._lastView = new LayerView(this, mapPosition); } } else { if (xMLTagReader.TagIs(RenderClip.GetXMLTag())) { this._renderClip = new RenderClip(context); } } } } } return; } throw new InvalidMashupFile(context, "Expected displayName attribute"); }
public SourceMapOverviewWindow() { InitializeComponent(); mapPos = new MapPosition(viewerControl); viewerControl.Initialize(GetMapPos, "Overview"); }