Ejemplo n.º 1
0
        private void SetProgressImages(ref bool bStateChange, ref Image FinalImage, ref string FinalText)
        {
            string comment;

            m_snapshotID = m_rServer.GetLatestSnapshotId();
            if (m_savedsnapshotID != m_snapshotID)
            {
                if (!m_snapshotAddedToTree)
                {
                    Program.gController.AddSnapshotToServer(m_rServer.ConnectionName, m_snapshotID);
                    m_snapshotAddedToTree        = true;
                    button_OK.Enabled            = true;
                    button_HideandNotify.Enabled = true;
                    m_currentStep = 2;
                    bStateChange  = true;
                }

                string status = m_rServer.GetCurrentJobStatus(out comment, m_snapshotID);

                if (string.Compare(status, Utility.Snapshot.StatusInProgress, true) == 0)
                {
                    string stepFmt  = ("In Progress - completed steps {0} of 7");
                    string stepText = string.Format(stepFmt, 1);
                    int    x        = 1;
                    for (x = 1; x < 8; x++)
                    {
                        stepText = string.Format(stepFmt, x);
                        if (string.Compare(comment, stepText, true) == 0)
                        {
                            if (x > m_currentStep)
                            {
                                m_currentStep = x;
                                bStateChange  = true;
                            }
                            break;
                        }
                    }
                }
                else if ((string.Compare(status, Utility.Snapshot.StatusSuccessful, true) == 0))
                {
                    SetStepImageToComplete();
                    FinalImage    = global::Idera.SQLsecure.UI.Console.Properties.Resources.check_50;
                    FinalText     = Utility.ErrorMsgs.JobSucceededMsg;
                    m_jobFinished = true;
                }
                else if (string.Compare(status, Utility.Snapshot.StatusError, true) == 0)
                {
                    SetStepImageToError();
                    FinalImage    = global::Idera.SQLsecure.UI.Console.Properties.Resources.error_50;
                    FinalText     = Utility.ErrorMsgs.JobFailedMsg;
                    FinalText    += string.Format("\r\n\r\nError:  {0}", comment);
                    m_jobFinished = true;
                }
                else if (string.Compare(status, Utility.Snapshot.StatusWarning, true) == 0)
                {
                    SetStepImageToComplete();
                    FinalImage    = global::Idera.SQLsecure.UI.Console.Properties.Resources.warning_50;
                    FinalText     = Sql.Snapshot.GetFormattedWarnings(comment);
                    m_jobFinished = true;
                }
            }
        }