Beispiel #1
0
        private void Main_Load(object sender, EventArgs e)
        {
            //Parameters hidden file open:
            loadParameters();

            //Show workspace launcher at the beginning:
            if (workspace == null)
            {
                WorkspaceLauncher workspaceLauncher = new WorkspaceLauncher(this);
                workspaceLauncher.Show();
            }
            else
            {
                // Try the location folder from the param file
                try
                {
                    loadWorkspace();

                    //If default workspace option choosed set parametrs in hidden param file
                    if (workspace.defaultOption)
                    {
                        // Remove the hidden attribute of the file   
                        if (File.Exists(parametersFileName))
                        {
                            FileInfo myFile = new FileInfo(parametersFileName);
                            myFile.Attributes &= ~FileAttributes.Hidden;
                        }

                        File.WriteAllText(parametersFileName, workspace.locationFolder);

                        FileInfo myFile1 = new FileInfo(parametersFileName);
                        // Set the hidden attribute of the file
                        myFile1.Attributes = FileAttributes.Hidden;
                    }
                }
                catch (Exception exc)
                {
                    DialogResult r = MessageBox.Show(this, "You will need to use another workspace\n" + exc.ToString(), "Problem open workspace", MessageBoxButtons.OKCancel);

                    if (r == DialogResult.OK)
                    {
                        // If fail, reset workspace
                        WorkspaceLauncher workspaceLauncher = new WorkspaceLauncher(this);
                        workspaceLauncher.Show();
                    }
                }

            }

            this.objectToObjectTracks = new Dictionary<Object, ObjectAnnotation>();
        }
Beispiel #2
0
 private void switchWorkspaceToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WorkspaceLauncher workspaceLauncher = new WorkspaceLauncher(this);
     workspaceLauncher.Show();
 }