コード例 #1
0
        private void removeIdentifierButton_Click(object sender, EventArgs e)
        {
            var identifierSummary = (IIdentifierSummary)((ComboBoxItem)identifierComboBox.SelectedItem).Value;

            var identifierValue = _formattingService.FormatIdentifier(identifierSummary.Identifier);

            var message = string.Format(CultureInfo.InvariantCulture, "{0} {1} {2}",
                                        Translator.Instance.Translate(ExtensionCatalog.Main, "WMID"), identifierValue,
                                        Translator.Instance.Translate(ExtensionCatalog.Main, "will be deleted."));

            if (DialogResult.OK != MessageBox.Show(this, message,
                                                   Translator.Instance.Translate(ExtensionCatalog.Main, "Сonfirm deletion"),
                                                   MessageBoxButtons.OKCancel,
                                                   MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2))
            {
                return;
            }

            try
            {
                _identifierService.RemoveSecondaryIdentifier(identifierSummary.Identifier);
            }
            catch (Exception exception)
            {
                ErrorFormDisplayHelper.BuildErrorForm(_sessionContext.ExtensionManager, exception).ShowDialog(this);
                return;
            }

            removeIdentifierButton.Enabled = false;
            UpdateComboBox();
        }
コード例 #2
0
        public Form GetForm(SessionContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (!new AccountService(context.UnityContainer).CheckingAccountExists())
            {
                return(ErrorFormDisplayHelper.BuildErrorForm(context.ExtensionManager, Resources.CreateTrustFormProvider_GetForm_Purses_list_is_empty,
                                                             Resources.CreateTrustFormProvider_GetForm_Please_refresh_the_list_of_purses_or_add_it_manually));
            }

            return(TrustDisplayHelper.CreateForm(context, null));
        }
コード例 #3
0
        public Form GetForm(CertificateContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (!new AccountService(context.UnityContainer).CheckingAccountExists())
            {
                return(ErrorFormDisplayHelper.BuildErrorForm(context.ExtensionManager,
                                                             Resources.CreateTrustFormProvider_GetForm_Purses_list_is_empty,
                                                             Resources.CreateTrustFormProvider_GetForm_Please_refresh_the_list_of_purses_or_add_it_manually));
            }

            var identifierValue = context.UnityContainer.Resolve <IFormattingService>()
                                  .FormatIdentifier(context.Certificate.Identifier);

            return(GetForm(context, identifierValue, null));
        }
        public Form GetForm(SessionContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (!new AccountService(context.UnityContainer).CheckingAccountExists())
            {
                return(ErrorFormDisplayHelper.BuildErrorForm(context.ExtensionManager, Resources.CreateTrustFormProvider_GetForm_Purses_list_is_empty,
                                                             Resources.CreateTrustFormProvider_GetForm_Please_refresh_the_list_of_purses_or_add_it_manually));
            }

            var template = TemplateLoader.LoadTemplate <TunableGridTemplate>(context.ExtensionManager, ExtensionCatalog.TransferRegister);

            var form = new TransferRegisterForm(context);

            form.ApplyTemlate(template);

            return(form);
        }