private void btnValider_Click(object sender, EventArgs e) { ArrayList pathesList = new ArrayList(); this.recursiveNodeSearch(this.treeview.Nodes[0], pathesList); try { Serialization.serializeToXML(pathesList, "folders.xml"); Serialization.serializeToXML(this.files, "files.xml"); } catch (Exception ex) { MessageBox.Show(ex.Message); } if (this.checkConfig()) { try { Directory.CreateDirectory(this.tbPath.Text + @"/test"); Directory.Delete(this.tbPath.Text + @"/test"); this.saveConfig(); Application.Restart(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void btnActualiser_Click(object sender, EventArgs e) { ArrayList pathesList = new ArrayList(); this.recursiveNodeSearch(this.treeview.Nodes[0], pathesList); try { Serialization.serializeToXML(pathesList, "folders.xml"); Serialization.serializeToXML(this.files, "files.xml"); } catch (Exception ex) { MessageBox.Show(ex.Message); } Thread th = new Thread(new ThreadStart(this.initWaitForm)); th.Start(); this.folders = Serialization.deserializeXML("folders.xml"); this.populatetreeView(); th.Abort(); }