예제 #1
0
파일: Main.cs 프로젝트: tuandnvn/ecat
 internal void setWorkspace(string locationFolder, bool defaultOption)
 {
     clearWorkspaceTreeview();
     workspace = new Workspace(locationFolder, defaultOption);
     loadWorkspace();
 }
예제 #2
0
파일: Main.cs 프로젝트: tuandnvn/ecat
        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;
            }
        }