Beispiel #1
0
 private void ValidateBtn_Click(object sender, RoutedEventArgs e)
 {
     if (IsEncrytedStrAvailableOnSol)
     {
         UCEncryptionKey.ValidateKey();
     }
     else
     {
         UCEncryptionKey.CheckKeyCombination();
     }
 }
Beispiel #2
0
        public void WizardEvent(WizardEventArgs WizardEventArgs)
        {
            switch (WizardEventArgs.EventType)
            {
            case EventType.Init:
                wiz = (ImportItemWizard)WizardEventArgs.Wizard;
                SetItemsListToImportGridView();
                wiz.ItemTypeListToImport = GetItemTypeListToImport();
                xItemTypesToImportGrid.DataSourceList = wiz.ItemTypeListToImport;
                break;

            case EventType.Active:
                ((WizardWindow)wiz.mWizardWindow).ShowFinishButton(false);

                UCEncryptionKey.mSolution = GlobalSolutionUtils.Instance.GetSolution();
                UCEncryptionKey.mSolution.SolutionOperations = new SolutionOperations(UCEncryptionKey.mSolution);
                if (!string.IsNullOrEmpty(wiz.EncryptionKey))
                {
                    UCEncryptionKey.EncryptionKeyPasswordBox.Password = wiz.EncryptionKey;
                    UCEncryptionKey.ValidateKey();
                }
                break;

            case EventType.LeavingForNextPage:
                if (string.IsNullOrEmpty(UCEncryptionKey.EncryptionKeyPasswordBox.Password))
                {
                    Reporter.ToUser(eUserMsgKey.StaticErrorMessage, "Please provide Solution Encryption Key.");
                    WizardEventArgs.CancelEvent = true;
                    return;
                }
                if (UCEncryptionKey.ValidateKey())
                {
                    wiz.EncryptionKey = UCEncryptionKey.EncryptionKeyPasswordBox.Password;
                    GlobalSolutionUtils.Instance.EncryptionKey = wiz.EncryptionKey;
                }
                else
                {
                    Reporter.ToUser(eUserMsgKey.StaticErrorMessage, "Loading Solution- Error: Encryption key validation failed.");
                    WizardEventArgs.CancelEvent = true;
                    return;
                }
                break;

            default:
                //Nothing to do
                break;
            }
        }
Beispiel #3
0
 private void SaveKeyBtn_Click(object sender, RoutedEventArgs e)
 {
     if (!IsEncrytedStrAvailableOnSol && UCEncryptionKey.CheckKeyCombination())
     {
         mSolution.EncryptionKey             = UCEncryptionKey.EncryptionKeyPasswordBox.Password;
         mSolution.NeedVariablesReEncryption = true;
         mSolution.SolutionOperations.SaveEncryptionKey();
         mSolution.SolutionOperations.SaveSolution(false);
         IsValidEncryptionKeyAdded = true;
         _pageGenericWin.Close();
     }
     else if (IsEncrytedStrAvailableOnSol && UCEncryptionKey.ValidateKey())
     {
         mSolution.SolutionOperations.SaveEncryptionKey();
         IsValidEncryptionKeyAdded = true;
         _pageGenericWin.Close();
     }
 }