private void tbGenerateXML_Click(object sender, EventArgs e)
 {
     if (_saveFileDialog.ShowDialog(this) == DialogResult.OK)
     {
         var serializer = new VirtualMovieFolderSerializer();
         serializer.SerializeTreeView(Properties.Settings.Default.Paths, _saveFileDialog.FileName);
     }
 }
        private void tbSaveVirtualTree_Click(object sender, EventArgs e)
        {
            if (_saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                var roots = (ArrayList)treeListVirtualFolders.Roots;
                var movies = new List<Movie>();

                foreach (Movie movie in roots)
                {
                    movies.Add(movie);
                }

                var serializer = new VirtualMovieFolderSerializer();
                serializer.SerializeTreeView(movies, _saveFileDialog.FileName);
            }
        }
 private void LoadVirtualTree()
 {
     if (_openFileDialog.ShowDialog(this) == DialogResult.OK)
     {
         var roots = new ArrayList();
         var serializer = new VirtualMovieFolderSerializer();
         var movie = serializer.DeserializeTreeView(_openFileDialog.FileName);
         foreach (var m in movie.Children)
             roots.Add(m);
         treeListVirtualFolders.Roots = roots;
     }
 }