Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
        private static void ReactivationExpected(string activationCode, Form activationForm)
        {
            // get existing password from user
            //***************
            // Reactivation is required.
            //***************

            string associatedProductKey = GetAssociatedProductKey(activationCode);
            if (!IsValidProductKey(associatedProductKey, activationCode))
            {
                Logger.Error("Invalid product key with activation code: " + activationCode);
                return;
            }

            //** code here to pop up a window asking for information

            string currPass, newPass;

            using (var dimmerMask = new DimmerMask(activationForm))
            {
                dimmerMask.Show(activationForm);

                var formReact = new TFReactivation
                                {
                                    lblCode = { Text = activationCode }
                                };
                formReact.ShowDialog();
                try
                {
                    if (formReact.DialogResult == DialogResult.OK)
                    {
                        currPass = formReact.tbCurrentPass.Text;
                        newPass = formReact.tbNewPass.Text;
                    }
                    else
                    {
                        return;
                    }
                }
                finally
                {
                    formReact.Dispose();
                }
            }

            int err;
            using (new HourGlass())
            {
                err = DNA.DNA_Reactivate(associatedProductKey, activationCode, currPass, newPass);
            }

            Logger.Info("Response to DNA_Reactivate: " + err);

            switch (err)
            {
                case DNA.ERR_NO_ERROR:
                    AnalyticsHelper.FireEvent("Reactivation - success");
                    MessageBox.Show("Activation successful! Thank you for purchasing Highlight Hunter Pro." + Environment.NewLine + Environment.NewLine +
                        "Enjoy!",
                        "Activation successful",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
                    break;

                case DNA.ERR_INVALID_NEW_PASSWORD:
                    AnalyticsHelper.FireEvent("Reactivation - invalid new password");
                    if (MessageBox.Show("Woops! For security reasons, you must choose a password that you haven't used before." + Environment.NewLine + Environment.NewLine +
                        "Try again?",
                        "Password already used",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Error) == DialogResult.Yes)
                    {
                        ReactivationExpected(activationCode, activationForm);
                    }
                    break;

                case DNA.ERR_INVALID_PASSWORD:
                    AnalyticsHelper.FireEvent("Reactivation - invalid password");
                    if (MessageBox.Show("Woops! It doesn't look like the original password is correct. If you forgot it, click Send Password." + Environment.NewLine + Environment.NewLine +
                        "Try again?",
                        "Wrong password",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Error) == DialogResult.Yes)
                    {
                        ReactivationExpected(activationCode, activationForm);
                    }
                    break;

                case DNA.ERR_NO_CONNECTION:
                case DNA.ERR_CONNECTION_LOST:
                    AnalyticsHelper.FireEvent("Reactivation - no connection");
                    if (RetryActivatingAfterConnectionWarning())
                        ReactivationExpected(activationCode, activationForm);
                    break;

                case DNA.ERR_LOCKOUT:
                    AnalyticsHelper.FireEvent("Reactivation - lockout");
                    ProtectionWarnings.WarnAboutLockout();
                    break;

                // intentionally don't provide more detailed information to user in case they're trying to hack

                default:
                    AnalyticsHelper.FireEvent("Reactivation - other error", err);
                    ProtectionWarnings.WarnAboutOtherError("ErrorReactivating", err);
                    break;
            }
        }
Ejemplo n.º 2
0
        private void ShowEULA()
        {
            if (Settings.Default.AgreedToEULA != false) return;

            Activate();

            using (var dimmerMask = new DimmerMask(this))
            {
                dimmerMask.Show(this);

                var consentForm = new ConsentForm();
                consentForm.ShowDialog();

                dimmerMask.Close();
            }

            if (Settings.Default.AgreedToEULA == false)
            {
                Application.Exit();
            }
        }
Ejemplo n.º 3
0
        private static void ActivationExpected(string activationCode, Form activationForm)
        {
            // get new password and email from user
            //*************
            // Activation is required
            //   need to capture a password, and optional email address for resending a lost password
            //*************

            string associatedProductKey = GetAssociatedProductKey(activationCode);
            if (!IsValidProductKey(associatedProductKey, activationCode))
            {
                Logger.Error("Invalid product key with activation code: " + activationCode);
                return;
            }

            //** code here to pop up a window asking for a password and email address

            string newPass, newEmail;

            using (var dimmerMask = new DimmerMask(activationForm))
            {
                dimmerMask.Show(activationForm);

                var formAct = new TFActivation
                                  {
                                      lblCode = { Text = activationCode }
                                  };
                formAct.ShowDialog(activationForm);
                try
                {
                    if (formAct.DialogResult == DialogResult.OK)
                    {
                        newPass = formAct.tbPass.Text;
                        newEmail = formAct.tbEmail.Text;
                    }
                    else
                    {
                        return;
                    }
                }
                finally
                {
                    formAct.Dispose();
                }
            }

            int err;
            using (new HourGlass())
            {
                err = DNA.DNA_Activate(associatedProductKey, activationCode, newPass, newEmail);
            }

            Logger.Info("Response to DNA_Activate: " + err);

            switch (err)
            {
                case DNA.ERR_NO_ERROR:
                    AnalyticsHelper.FireEvent("Activation - success");

                    AnalyticsHelper.FireEvent("Activation - days left in trial", GetDaysLeftInTrial());

                    MessageBox.Show("Thank you for purchasing Highlight Hunter Pro." + Environment.NewLine + Environment.NewLine +
                        "Enjoy!",
                        "Great success!",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
                    break;

                case DNA.ERR_NO_CONNECTION:
                case DNA.ERR_CONNECTION_LOST:
                    AnalyticsHelper.FireEvent("Activation - no connection");
                    if (RetryActivatingAfterConnectionWarning())
                        ActivationExpected(activationCode, activationForm);
                    break;

                case DNA.ERR_LOCKOUT:
                    AnalyticsHelper.FireEvent("Activation - lockout");
                    ProtectionWarnings.WarnAboutLockout();
                    break;

                // intentionally don't provide more detailed information to user in case they're trying to hack

                default:
                    AnalyticsHelper.FireEvent("Activation - other error", err);
                    ProtectionWarnings.WarnAboutOtherError("ErrorActivating", err);
                    break;
            }
        }
Ejemplo n.º 4
0
        private void settingsPictureButtonControl_Click(object sender, EventArgs e)
        {
            using (var dimmerMask = new DimmerMask(this))
            {
                dimmerMask.Show(this);

                using (var sf = new SettingsForm())
                {
                    sf.ShowDialog();
                }
                AnalyticsHelper.OptedIn = Settings.Default.OptIntoAnalytics;

                UpdateUIwithLicenseStatus();

                dimmerMask.Close();
            }
            //dimmerMask = null;
        }
Ejemplo n.º 5
0
        private void DisplayTutorial()
        {
            TutorialHelper.ResetProgress();

            TutorialHelper.TutorialStarted();

            selectInputVideosControl.InitializeSampleVideoTutorialBubble();

            tutorialEscapeHatch.RefreshProgress();
            tutorialEscapeHatch.Visible = true;

            using (var dimmerMask = new DimmerMask(this))
            {
                dimmerMask.Show(this);

                var fr = new TutorialForm
                {
                    CloseHandler = UpdateUIwithDRMStatusHandler
                };
                fr.ShowDialog();

                dimmerMask.Close();
            }
        }
Ejemplo n.º 6
0
        private void DisplayActivationOptions()
        {
            using (var dimmerMask = new DimmerMask(this))
            {
                dimmerMask.Show(this);

                using (var awForm = new ActivationWelcome())
                {
                    awForm.ShowDialog();
                }

                dimmerMask.Close();
            }

            UpdateUIwithLicenseStatus();
        }
Ejemplo n.º 7
0
        private void highlightThumbnailControl_HighlightDetailsOpening(object sender, HighlightEventArgs e)
        {
            using (var dimmerMask = new DimmerMask(this.ParentForm))
            {
                dimmerMask.Show(this.ParentForm);

                using (highlightDetailsForm = new HighlightDetailsForm())
                {
                    highlightDetailsForm.InitialHighlightIndex = e.HighlightObject.HighlightObjectIndex;
                    highlightDetailsForm.HighlightRemoved += highlightDetailsForm_HighlightRemoved;
                    highlightDetailsForm.InitializeStartOverTutorialBubble += highlightDetailsForm_InitializeStartOverTutorialBubble;
                    highlightDetailsForm.TutorialProgressUpdated += highlightDetailsForm_TutorialProgressUpdated;

                    if (highlightsFoundTutorialBubble.Visible)
                        highlightsFoundTutorialBubble_Advance(null, EventArgs.Empty);

                    if (HighlightDetailsOpened != null)
                        HighlightDetailsOpened(sender, e);

                    highlightDetailsForm.ShowDialog();

                    if (HighlightDetailsClosed != null)
                        HighlightDetailsClosed(sender, e);
                }

                dimmerMask.Close();
            }
        }
Ejemplo n.º 8
0
        private void activateLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            using (var dimmerMask = new DimmerMask(this))
            {
                dimmerMask.Show(this);
                using (var awForm = new ActivationWelcome())
                {
                    awForm.ShowDialog();
                }
            }

            UpdateLicenseUI();
        }