private List <string> getSavesList() // var saves = getSevesList(); { var store = new VFileStorage(log); var res = store.getFilesList(); // new List<string>(); return(res); }
} // public static string mapConfig(ESRI.ArcGIS.Client.Map map) private VFileStorage openStorage(string filename) // create and init storage object { log("VSave.openStorage, ..."); var res = new VFileStorage(log); res.create(filename); log("VSave.openStorage, done."); return(res); }
} // public static VFileStorage openStorage4Read(string foldername, string filename) public static VFileStorage openStorage4Write(string foldername, string filename) // create and init storage object //log("openStorage4Write, ..."); { var res = new VFileStorage(null); res.setFolder(foldername); res.create(filename); return(res); } // public static VFileStorage openStorage4Write(string foldername, string filename) { // create and init storage object
} // public void open(string filename) { // open file //stor.open(filename); public static VFileStorage openStorage4Read(string foldername, string filename) { //log("openStorage4Read, ..."); var res = new VFileStorage(null); res.setFolder(foldername); res.open(filename); return(res); } // public static VFileStorage openStorage4Read(string foldername, string filename)
} // internal void restoreMap(string filename) private string readMapConfig(string filename) //invoke from restoreMap method: string cfg = readMapConfig(filename); // from VFileStorage // return json string from save { var stor = new VFileStorage(log); stor.open(filename); string cfg = stor.read(); log(string.Format("VRestore.readMapConfig, cfg [{0}]", cfg)); return(cfg); //throw new Exception("VRestore.readMapConfig, not yet"); }
} // void wc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e) internal void saveMap(string mapname) { log(string.Format("VSave.saveMap, mapname [{0}] ...", mapname)); if (currentCfg == "") { currentCfg = getMapConfig(); } VFileStorage stor = openStorage(mapname); stor.write(currentCfg); stor.close(); // if all ok MapApplication.Current.HideWindow(saveWnd); log(string.Format("VSave.saveMap, done.")); } // internal void saveMap(string mapname)
internal void deleteMap(string filename) { var stor = new VFileStorage(log); stor.open(filename); string cfg = stor.read(); log(string.Format("VRestore.deleteMap, fname [{0}], content [{1}]", filename, cfg)); stor.delete(filename); return; //restoreWnd.listBox1.Items.Clear(); //var saves = getSavesList(); //foreach(string fn in saves) { //restoreWnd.listBox1.Items.Add(fn); //} } // internal void deleteMap(string filename)