private void button_desirialize_Click(object sender, EventArgs e) { openFileDialog.Title = "Choose file to deserialize your directory"; openFileDialog.Filter = "Bin files (*.bin)|*.bin"; if (openFileDialog.ShowDialog() == DialogResult.OK) { if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { label_notifications.Text = "Deserializing directory. Please wait..."; DirectorySerializer serializer = new DirectorySerializer(); serializer.Deserialize(openFileDialog.FileName, folderBrowserDialog.SelectedPath); label_notifications.Text = string.Empty; } } }
private void button_serialize_Click(object sender, EventArgs e) { folderBrowserDialog.Description = "Select folder to serialize"; folderBrowserDialog.ShowDialog(); DirectoryInfo directoryInfo = new DirectoryInfo(folderBrowserDialog.SelectedPath); saveFileDialog.InitialDirectory = folderBrowserDialog.SelectedPath; saveFileDialog.Title = "Choose file to serialize your directory"; saveFileDialog.Filter = "Bin files (*.bin)|*.bin"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { label_notifications.Text = "Serializing directory. Please wait..."; DirectorySerializer serializer = new DirectorySerializer(); serializer.Serialize(folderBrowserDialog.SelectedPath, saveFileDialog.FileName); label_notifications.Text = string.Empty; } }