Ejemplo n.º 1
0
        private void sectionsListView_Click(object sender, EventArgs e)
        {
            switch (sectionsListView.FocusedItem.Index)
            {
            case 0:
                var newProjectDialog = new NewProjectDialog();
                newProjectDialog.ShowDialog();
                break;

            case 1:
                using (var fileDialog = new OpenFileDialog())
                {
                    fileDialog.Filter      = "nUpdate Project Files (*.nupdproj)|*.nupdproj";
                    fileDialog.Multiselect = false;
                    if (fileDialog.ShowDialog() == DialogResult.OK)
                    {
                        Project = OpenProject(fileDialog.FileName);
                        if (Project == null)
                        {
                            return;
                        }

                        var projectDialog = new ProjectDialog
                        {
                            Project       = Project,
                            FtpPassword   = _ftpPassword.Copy(),
                            ProxyPassword = _proxyPassword.Copy(),
                            SqlPassword   = _sqlPassword.Copy()
                        };
                        if (projectDialog.ShowDialog() == DialogResult.OK)
                        {
                            _ftpPassword.Dispose();
                            _proxyPassword.Dispose();
                            _sqlPassword.Dispose();
                        }
                    }
                }
                break;

            case 2:
                var projectRemovalDialog = new ProjectRemovalDialog();
                projectRemovalDialog.ShowDialog();
                break;

            case 3:
                using (var fileDialog = new OpenFileDialog())
                {
                    fileDialog.Filter      = "nUpdate Project Files (*.nupdproj)|*.nupdproj";
                    fileDialog.Multiselect = false;
                    if (fileDialog.ShowDialog() == DialogResult.OK)
                    {
                        Project = OpenProject(fileDialog.FileName);
                        if (Project == null)
                        {
                            return;
                        }

                        var projectEditDialog = new ProjectEditDialog
                        {
                            Project       = Project,
                            FtpPassword   = _ftpPassword,
                            ProxyPassword = _proxyPassword,
                            SqlPassword   = _sqlPassword
                        };
                        if (projectEditDialog.ShowDialog() == DialogResult.OK)
                        {
                            _ftpPassword.Dispose();
                            _proxyPassword.Dispose();
                            _sqlPassword.Dispose();
                        }
                    }
                }
                break;

            case 4:
                var projectImportDialog = new ProjectImportDialog();
                projectImportDialog.ShowDialog();
                break;

            case 5:
                var feedbackDialog = new FeedbackDialog();
                feedbackDialog.ShowDialog();
                break;

            case 6:
                var preferencesDialog = new PreferencesDialog();
                preferencesDialog.ShowDialog();
                break;

            case 7:
                var infoDialog = new InfoDialog();
                infoDialog.ShowDialog();
                break;

            case 8:
                var statisticsServerDialog = new StatisticsServerDialog {
                    ReactsOnKeyDown = false
                };
                statisticsServerDialog.ShowDialog();
                break;
            }
        }
Ejemplo n.º 2
0
        private void sectionsListView_Click(object sender, EventArgs e)
        {
            switch (sectionsListView.FocusedItem.Index)
            {
                case 0:
                    var newProjectDialog = new NewProjectDialog();
                    newProjectDialog.ShowDialog();
                    break;

                case 1:
                    using (var fileDialog = new OpenFileDialog())
                    {
                        fileDialog.Filter = "nUpdate Project Files (*.nupdproj)|*.nupdproj";
                        fileDialog.Multiselect = false;
                        if (fileDialog.ShowDialog() == DialogResult.OK)
                        {
                            Project = OpenProject(fileDialog.FileName);
                            if (Project == null)
                                return;

                            var projectDialog = new ProjectDialog
                            {
                                Project = Project,
                                FtpPassword = _ftpPassword.Copy(),
                                ProxyPassword = _proxyPassword.Copy(),
                                SqlPassword = _sqlPassword.Copy()
                            };
                            if (projectDialog.ShowDialog() == DialogResult.OK)
                            {
                                _ftpPassword.Dispose();
                                _proxyPassword.Dispose();
                                _sqlPassword.Dispose();
                            }
                        }
                    }
                    break;

                case 2:
                    var projectRemovalDialog = new ProjectRemovalDialog();
                    projectRemovalDialog.ShowDialog();
                    break;

                case 3:
                    using (var fileDialog = new OpenFileDialog())
                    {
                        fileDialog.Filter = "nUpdate Project Files (*.nupdproj)|*.nupdproj";
                        fileDialog.Multiselect = false;
                        if (fileDialog.ShowDialog() == DialogResult.OK)
                        {
                            Project = OpenProject(fileDialog.FileName);
                            if (Project == null)
                                return;

                            var projectEditDialog = new ProjectEditDialog
                            {
                                Project = Project,
                                FtpPassword = _ftpPassword,
                                ProxyPassword = _proxyPassword,
                                SqlPassword = _sqlPassword
                            };
                            if (projectEditDialog.ShowDialog() == DialogResult.OK)
                            {
                                _ftpPassword.Dispose();
                                _proxyPassword.Dispose();
                                _sqlPassword.Dispose();
                            }
                        }
                    }
                    break;

                case 4:
                    var projectImportDialog = new ProjectImportDialog();
                    projectImportDialog.ShowDialog();
                    break;

                case 5:
                    var feedbackDialog = new FeedbackDialog();
                    feedbackDialog.ShowDialog();
                    break;

                case 6:
                    var preferencesDialog = new PreferencesDialog();
                    preferencesDialog.ShowDialog();
                    break;

                case 7:
                    var infoDialog = new InfoDialog();
                    infoDialog.ShowDialog();
                    break;
                case 8:
                    var statisticsServerDialog = new StatisticsServerDialog {ReactsOnKeyDown = false};
                    statisticsServerDialog.ShowDialog();
                    break;
            }
        }
Ejemplo n.º 3
0
        private void sectionsListView_Click(object sender, EventArgs e)
        {
            switch (sectionsListView.FocusedItem.Index)
            {
            case 0:
                var newProjectDialog = new NewProjectDialog();
                newProjectDialog.ShowDialog();
                break;

            case 1:
                using (var fileDialog = new OpenFileDialog())
                {
                    fileDialog.Filter      = "nUpdate Project Files (*.nupdproj)|*.nupdproj";
                    fileDialog.Multiselect = false;
                    if (fileDialog.ShowDialog() == DialogResult.OK)
                    {
                        Project = OpenProject(fileDialog.FileName);
                        if (Project == null)
                        {
                            return;
                        }

                        var projectDialog = new ProjectDialog
                        {
                            Project       = Project,
                            FtpPassword   = _ftpPassword.Copy(),
                            ProxyPassword = _proxyPassword.Copy(),
                            SqlPassword   = _sqlPassword.Copy()
                        };
                        if (projectDialog.ShowDialog() == DialogResult.OK)
                        {
                            _ftpPassword.Dispose();
                            _proxyPassword.Dispose();
                            _sqlPassword.Dispose();
                        }
                    }
                }
                break;

            case 2:
                var projectRemovalDialog = new ProjectRemovalDialog();
                projectRemovalDialog.ShowDialog();
                break;

            case 3:
                using (var fileDialog = new OpenFileDialog())
                {
                    fileDialog.Filter      = "nUpdate Project Files (*.nupdproj)|*.nupdproj";
                    fileDialog.Multiselect = false;
                    if (fileDialog.ShowDialog() == DialogResult.OK)
                    {
                        Project = OpenProject(fileDialog.FileName);
                        if (Project == null)
                        {
                            return;
                        }

                        var projectEditDialog = new ProjectEditDialog
                        {
                            Project       = Project,
                            FtpPassword   = _ftpPassword,
                            ProxyPassword = _proxyPassword,
                            SqlPassword   = _sqlPassword
                        };
                        if (projectEditDialog.ShowDialog() == DialogResult.OK)
                        {
                            _ftpPassword.Dispose();
                            _proxyPassword.Dispose();
                            _sqlPassword.Dispose();
                        }
                    }
                }
                break;

            case 4:
                var feedbackDialog = new FeedbackDialog();
                feedbackDialog.ShowDialog();
                break;

            case 5:
                var preferencesDialog = new PreferencesDialog();
                preferencesDialog.ShowDialog();
                break;

            case 6:
                var infoDialog = new InfoDialog();
                infoDialog.ShowDialog();
                break;

            case 7:
                var statisticsServerDialog = new StatisticsServerDialog {
                    ReactsOnKeyDown = false
                };
                statisticsServerDialog.ShowDialog();
                break;

            case 8:
                Popup.ShowPopup(this, SystemIcons.Information, "Feature not implemented yet.",
                                "This is the first version of nUpdate Administration. The conversion will be available in coming versions as soon as changes to the configuration schemata are made.",
                                PopupButtons.Ok);
                break;
            }
        }