public void ReloadInstalledMaps() { IEnumerable<OfflineMapInfo> installedMaps = OfflineMapInfo.InstalledMaps; HashSet<string> installedMapCodes = new HashSet<string> (); HashSet<string> removedMapCodes = new HashSet<string> (); foreach (var m in installedMaps) { if (!this._installedMaps.ContainsKey (m.code)) { OfflineMapInfoElement e = new OfflineMapInfoElement (this.ParentVC, m); this._installedMaps.Add (m.code, e); this.Add (e); } installedMapCodes.Add (m.code); } foreach (var k in this._installedMaps) { if (!installedMapCodes.Contains (k.Key)) { removedMapCodes.Add (k.Key); } } foreach (var code in removedMapCodes) { Element e = this._installedMaps [code]; this.Remove (e); this._installedMaps.Remove (code); } }
public override void ViewDidLoad () { base.ViewDidLoad (); Section s = new Section (); foreach (var c in this._mapInfo.children) { OfflineMapInfoElement e = new OfflineMapInfoElement (this, c); s.Add (e); } RootElement root = new RootElement (this._mapInfo.LocalizedName) { s }; this.Root = root; }