示例#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);
                }
            }
        }
示例#2
0
        public void addTab(ProjectSettings ps)
        {
            string   strProName = ps.ProjectName;                         //Sets currently selected tab to this new tab
            cTabPage tabPage    = new cTabPage(strProName, this);

            _dicTabPages.Add(strProName, tabPage);
            _dicTabPages[strProName].updateSettings(ps);                         //Updates/Adds project settings to tab
            List <TargetSettings> lstTargets = _proInter.getTargets(strProName); //Fetchs, if any, upload target addresses

            if (lstTargets.Count > 0)                                            //If Uploadfolders exist, add to tab display
            {
                _dicTabPages[strProName].addMultipleTargets(lstTargets);
            }
            _Main.addTabPage(tabPage);
        }