Exemple #1
0
        private void cleanUpBtn_Click(object sender, System.EventArgs e)
        {
            // Verify the user is ok w/ stopping the archive service
            DialogResult dr = RtlAwareMessageBox.Show(this, Strings.CleanUpDatabaseText, Strings.CleanUpDatabaseTitle,
                                                      MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, (MessageBoxOptions)0);

            if (dr != DialogResult.OK)
            {
                return;
            }

            // Stop the archive service, if we can.
            bool stoppedService = false;

            if (serviceButtons.ServiceController != null && serviceButtons.ServiceController.Running)
            {
                stoppedService = true;
                serviceButtons.ServiceController.StopServiceAndWait();
            }
            if (serviceButtons.ServiceController != null && serviceButtons.ServiceController.Running)
            {
                return;
            }

            // Do the DB operation
            conferencesTreeView.CleanUpDatabase();

            // Restart Service
            if (stoppedService)
            {
                serviceButtons.ServiceController.StartServiceAndWait();
            }
        }
Exemple #2
0
        private void cleanUpBtn_Click(object sender, System.EventArgs e)
        {
            // Verify the user is ok w/ stopping the archive service
            DialogResult dr = MessageBox.Show(this,
                                              "The Clean Up Database feature removes the following \n" +
                                              "records from your Archive Service database:\n" +
                                              " - Conferences without participants\n" +
                                              " - Participants without streams\n" +
                                              " - Streams without recorded frames\n" +
                                              " - Streams without raw data\n\n" +
                                              "To complete these tasks, the Archive Service must be\n" +
                                              "stopped. Clicking OK temporarily stops this service,\n" +
                                              "causing any current conference recordings to stop.",
                                              "Clean Up Database", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning,
                                              MessageBoxDefaultButton.Button2);

            if (dr != DialogResult.OK)
            {
                return;
            }

            // Stop the archive service, if we can.
            bool stoppedService = false;

            if (serviceButtons.ServiceController != null && serviceButtons.ServiceController.Running)
            {
                stoppedService = true;
                serviceButtons.ServiceController.StopServiceAndWait();
            }
            if (serviceButtons.ServiceController != null && serviceButtons.ServiceController.Running)
            {
                return;
            }

            // Do the DB operation
            conferencesTreeView.CleanUpDatabase();

            // Restart Service
            if (stoppedService)
            {
                serviceButtons.ServiceController.StartServiceAndWait();
            }
        }