Esempio n. 1
0
        /// <summary>
        /// Saves the TreePaths (expanded rows) of the selected assemblies in a file.
        /// </summary>
        ///
        private void SaveSelectedAssembliesTreePaths()
        {
            // Get the state of all the rows
            store.Foreach(ForeachRow);
            Gtk.TreePath       p = null;
            Gtk.TreeViewColumn c = null;

            // Get the current activated row
            assemblyTree.GetCursor(out p, out c);

            FileStream file = new FileStream(Path.Combine(reflector.GetConfigurationDirectory(),
                                                          "SolidReflector.session"), FileMode.Create,
                                             FileAccess.ReadWrite);

            // Save the states of the rows in file
            using (StreamWriter writer = new StreamWriter(file)) {
                foreach (string path in treePaths)
                {
                    writer.WriteLine(path.ToString());
                }

                // Save the current activated row so it will be reactivated when the app is restarted
                // The entry is saved last in the file
                writer.WriteLine(p.ToString());
                writer.Flush();
            }
        }