public void DeserializeProperties() { try { if (File.Exists(PropertyfileName) == false) { return; } else { using (Stream stream = File.Open(PropertyfileName, FileMode.Open)) { PropertyLog log = PropertyLog.Create; BinaryFormatter bin = new BinaryFormatter(); var profiles = (Dictionary <string, Property>)bin.Deserialize(stream); foreach (var x in profiles) { if (log.Contains(x.Key) == false) { log.Add(x.Value); } } } } } catch (IOException ex) { throw new Exception(ex.Message); } }
public void PrintAllProperties() { int count = 0; PropertyLog log = PropertyLog.Create; // richTextBox1.Text += "------------------------\n\n"; foreach (KeyValuePair <string, Property> x in log.propertyList) { SetRichboxText(++count + ": LMA= " + x.Value.IsLandMarkCertified + " -SPH=" + x.Value.IsSphCertified + " - " + x.Value.PID + " - " + x.Value.Adress + "\n"); SetRichboxText("LandMarkAdress=" + x.Value.LMA + "\n\n"); // richTextBox1.Update(); } }
//D://Imaginarydata.bin public void SerializeProperties() { try { using (Stream stream = File.Open(PropertyfileName, FileMode.Create)) { PropertyLog log = PropertyLog.Create; BinaryFormatter bin = new BinaryFormatter(); bin.Serialize(stream, log.propertyList); } } catch (IOException ex) { throw new Exception(ex.Message); } }
internal string DownloadAllImages(StartPage startPage) { ApplicationData data = ApplicationData.Create; PropertyLog log = PropertyLog.Create; StringBuilder builder = new StringBuilder(); foreach (var p in log.propertyList) { string adress = "https://www.google.com/maps/place/" + p.Value.Adress.Replace(" ", "+").Replace(",", "") + "/"; if (Directory.Exists(data.ImageOutputDirectory + "//" + p.Value.Adress)) { string[] names = Directory.GetFiles(p.Value.Adress); if (names.Count() >= 4) { continue; } } builder.Clear(); builder.Append(data.ImageOutputDirectory + "//" + p.Value.Adress + "//"); // SetRichboxText("Downloading..." + p.Value.Adress); GSVTool tool = new GSVTool(adress, builder.ToString(), startPage); // this.Hide(); tool.Activate(); tool.ShowDialog(); if (tool.IsStopped == true) { break; } if (tool.completed == true) { // tool.Close(); continue; } //else //{ // tool.Activate(); // Application.DoEvents(); //} } // this.Show(); return null; }