Пример #1
0
 internal void setWorkspace(string locationFolder, bool defaultOption)
 {
     clearWorkspaceTreeview();
     workspace = new Workspace(locationFolder, defaultOption);
     loadWorkspace();
 }
Пример #2
0
        private void loadParameters()
        {
            //1)Check if file exists
            if (!File.Exists(parametersFileName))
            {
            }
            else//File already exists:
            {
                //Set file as hidden                
                FileInfo myFile = new FileInfo(parametersFileName);
                // Remove the hidden attribute of the file
                myFile.Attributes &= ~FileAttributes.Hidden;

                //Read file line by line
                List<String> list = new List<String>();
                string line;

                // Read the file and display it line by line.
                System.IO.StreamReader file =
                   new System.IO.StreamReader(parametersFileName);
                while ((line = file.ReadLine()) != null)
                {
                    list.Add(line);
                }
                if (list.Count == 1)
                {
                    workspace = new Workspace(list[0], true);
                }
                file.Close();
                myFile.Attributes |= FileAttributes.Hidden;
            }
        }