示例#1
0
        ///
        /// <summary>
        /// Adds a new target to the project
        /// </summary>
        public void addTarget()
        {
            if (_strTabIndex != "") //Check if there is a project open
            {
                try
                {
                    List <TargetSettings> targetList      = _proInter.getTargets(_strTabIndex); //List of targets in the current project, passed to addTargetDialog to prevent duplicate targets
                    frmAddTarget          addTargetDialog = new frmAddTarget(targetList);       //Opens as new addTargetDialog

                    if (addTargetDialog.ShowDialog() == DialogResult.OK)
                    {
                        TargetSettings ts = addTargetDialog.getTargetSettings(); //Fetches target settings from addTargetDialog
                        _proInter.addTarget(_strTabIndex, ts);                   //Adds target to project
                    }
                    enableTargetButtons();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("There has been an error: \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }