// given an index descriptor, seek to and return place information PlaceItem GetPlaceItemFromIndexEntry(WplIndexEntry ie, MetaDataAction metaDataAction) { using (BinaryReader brWwp = OpenWwpReader(ie.fileNumber)) { // seek to the relevant info brWwp.BaseStream.Seek(ie.seekOffset, SeekOrigin.Begin); // create a new PlaceItem PlaceItem pi = new PlaceItem(); pi.pn = new WorldWindPlacename(); // set placeNameSet info pi.placeDescriptor = this.m_placeNameSet; // now read the rest from the WWP file ReadPlaceName(brWwp, ref pi.pn, metaDataAction); return(pi); } }
/// <summary> /// Loads an index from file (implicitly known via the name of the wpl file) /// </summary> /// <param name="pr">Callback to provide progress report</param> public void Load(ProgressReportDelegate pr) { // initialize Reader using (BinaryReader brIdx = OpenBinReader(IndexFileName())) { // read index entry count int nCount = brIdx.ReadInt32(); // allocate an array of that size this.m_indexEntries = new WplIndexEntry [nCount]; // read index entries for (int i = 0; i < nCount; i++) { WplIndexEntry ie = new WplIndexEntry(); ie.fileNumber = brIdx.ReadInt16(); // read file number ie.seekOffset = brIdx.ReadInt32(); // read seek offset m_indexEntries[i] = ie; } } }
/// <summary> /// Loads an index from file (implicitly known via the name of the wpl file) /// </summary> /// <param name="pr">Callback to provide progress report</param> public void Load(ProgressReportDelegate pr) { // initialize Reader using(BinaryReader brIdx = OpenBinReader(IndexFileName())) { // read index entry count int nCount = brIdx.ReadInt32(); // allocate an array of that size this.m_indexEntries = new WplIndexEntry [nCount]; // read index entries for(int i = 0; i < nCount; i++) { WplIndexEntry ie = new WplIndexEntry(); ie.fileNumber = brIdx.ReadInt16(); // read file number ie.seekOffset = brIdx.ReadInt32(); // read seek offset m_indexEntries[i] = ie; } } }
// given an index descriptor, seek to and return place information PlaceItem GetPlaceItemFromIndexEntry(WplIndexEntry ie, MetaDataAction metaDataAction) { using( BinaryReader brWwp = OpenWwpReader(ie.fileNumber) ) { // seek to the relevant info brWwp.BaseStream.Seek(ie.seekOffset, SeekOrigin.Begin); // create a new PlaceItem PlaceItem pi = new PlaceItem(); pi.pn = new WorldWindPlacename(); // set placeNameSet info pi.placeDescriptor = this.m_placeNameSet; // now read the rest from the WWP file ReadPlaceName(brWwp, ref pi.pn, metaDataAction); return pi; } }