Пример #1
0
    public static string ShowForm()
    {
        returnval = null;
        SetPassword SP = new SetPassword();

        SP.ShowDialog();
        return(returnval);
    }
Пример #2
0
        private void btnPassword_Click(object sender, EventArgs e)
        {
            // パスワード変更
            SetPassword setPassword = new SetPassword
            {
                Text = btnPassword.Text
            };

            setPassword.ShowDialog();
        }
Пример #3
0
        private void SetupViews()
        {
            Messenger.Default.Register <string>(this, "OpenAboutView", (string s) => About.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseAboutView", (string s) => About.Close());

            Messenger.Default.Register <string>(this, "OpenCreateWalletView", (string s) => CreateWallet.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseCreateWalletView", (string s) => CreateWallet.Close());

            Messenger.Default.Register <string>(this, "OpenLicenseView", (string s) => License.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseLicenseView", (string s) => License.Close());

            Messenger.Default.Register <string>(this, "OpenManageWalletView", (string s) => ManageWallet.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseManageWalletView", (string s) => ManageWallet.Close());

            Messenger.Default.Register <string>(this, "OpenPromptPasswordView", (string s) => PromptPassword.ShowDialog());
            Messenger.Default.Register <string>(this, "ClosePromptPasswordView", (string s) => PromptPassword.Close());

            Messenger.Default.Register <string>(this, "OpenReceiveView", (string s) => Receive.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseReceiveView", (string s) => Receive.Close());

            Messenger.Default.Register <string>(this, "OpenRecoverWalletView", (string s) => RecoverWallet.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseRecoverWalletView", (string s) => RecoverWallet.Close());

            Messenger.Default.Register <string>(this, "OpenRecoveryPhraseView", (string s) => RecoveryPhrase.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseRecoveryPhraseView", (string s) => RecoveryPhrase.Close());

            Messenger.Default.Register <string>(this, "OpenSendView", (string s) => Send.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseSendView", (string s) => Send.Close());

            Messenger.Default.Register <string>(this, "OpenSetLanguageView", (string s) => SetLanguage.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseSetLanguageView", (string s) => SetLanguage.Close());

            Messenger.Default.Register <string>(this, "OpenSetPasswordView", (string s) => SetPassword.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseSetPasswordView", (string s) => SetPassword.Close());

            Messenger.Default.Register <string>(this, "OpenSimpleDialogView", (string s) => SimpleDialog.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseSimpleDialogView", (string s) => SimpleDialog.Close());

            Messenger.Default.Register <string>(this, "OpenTxInfoView", (string s) => TxInfo.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseTxInfoView", (string s) => TxInfo.Close());

            Messenger.Default.Register <string>(this, "OpenWalletInfoView", (string s) => WalletInfo.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseWalletInfoView", (string s) => WalletInfo.Close());

            Messenger.Default.Register <string>(this, "OpenWelcomeView", (string s) => Welcome.ShowDialog());
            Messenger.Default.Register <string>(this, "CloseWelcomeView", (string s) => Welcome.Close());
        }
Пример #4
0
        public static bool PDFSign(string inputfile, string outputfile, STabCard sTabCard)
        {
            try
            {
                Certificate cert = new Certificate();
                int         i    = 3;
                for (i = 3; i > 0; i--)
                {
                    if (SystemSingleton.CurrentSession.CertPassword == "")
                    {
                        SetPassword window = new SetPassword();
                        window.ShowDialog();
                    }
                    try
                    {
                        cert = new Certificate(SystemSingleton.Configuration.CertificatePath, SystemSingleton.CurrentSession.CertPassword);
                        break;
                    }
                    catch
                    {
                        EnvironmentHelper.SendDialogBox(
                            (string)SystemSingleton.Configuration.mainWindow.FindResource("m_CertPassError") + " " + (i - 1),
                            "Certificate/Password Error"
                            );
                        SystemSingleton.CurrentSession.CertPassword = "";
                    }
                }
                if (i == 0)
                {
                    EnvironmentHelper.SendDialogBox(
                        (string)SystemSingleton.Configuration.mainWindow.FindResource("m_CantSaveFile"),
                        "File Error"
                        );
                    return(false);
                }
                MetaData MD = new MetaData();
                MD.Author   = SystemSingleton.CurrentSession.FullName;
                MD.Title    = sTabCard.Card.Task.Number;
                MD.Subject  = sTabCard.Card.DocType.Caption;
                MD.Keywords = sTabCard.Card.Task.Commentary;
                MD.Creator  = sTabCard.Card.From.FullName;
                MD.Producer = SystemSingleton.Configuration.CompanyName;

                PdfReader  reader = new PdfReader(inputfile);
                PdfStamper st     = PdfStamper.CreateSignature(reader, new FileStream(outputfile, FileMode.Create, FileAccess.Write), '\0', null, true);

                st.MoreInfo    = MD.getMetaData();
                st.XmpMetadata = MD.getStreamedMetaData();
                PdfSignatureAppearance sap = st.SignatureAppearance;

                sap.SetCrypto(cert.Akp, cert.Chain, null, PdfSignatureAppearance.WINCER_SIGNED);
                sap.Reason   = "Completition";
                sap.Contact  = MD.Producer;
                sap.Location = SystemSingleton.Configuration.CompanyLocation;
                if (SystemSingleton.Configuration.SignVisible)
                {
                    sap.SetVisibleSignature(new iTextSharp.text.Rectangle(100, 100, 250, 150), 1, null);
                }
                st.Close();
                return(true);
            }
            catch
            {
                EnvironmentHelper.SendDialogBox(
                    (string)SystemSingleton.Configuration.mainWindow.FindResource("m_CantSaveFile"),
                    "File Error"
                    );
                return(false);
            }
        }