示例#1
0
        static void Main(string[] args1)
        {
            System.Diagnostics.Debug.Assert(true);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string[] args = { "/v", "D:\\certificado_digital\\Doc3.docx" };

            if (args.Length > 0)
            {
                string[] paths = args[1].Split('|');
                switch (args[0])
                {
                case "/v":
                    if ((paths.Length <= 1) && System.IO.Path.HasExtension(paths[0]))
                    {
                        frmManageDigitalSignature frmManage = new frmManageDigitalSignature(paths, false);
                        notifyInconInstance(frmManage.components);
                        Application.Run(frmManage);
                    }
                    else
                    {
                        frmIncludeSubFolders frmInclude = new frmIncludeSubFolders(paths, args[0]);
                        notifyInconInstance(frmInclude.components);
                        Application.Run(frmInclude);
                    }
                    break;

                case "/r":
                    if ((paths.Length <= 1) && System.IO.Path.HasExtension(paths[0]))
                    {
                        frmSelectDigitalSignatureToRemove frmSelect = new frmSelectDigitalSignatureToRemove(paths, false);
                        notifyInconInstance(frmSelect.components);
                        Application.Run(frmSelect);
                    }
                    else
                    {
                        frmIncludeSubFolders frmInclude = new frmIncludeSubFolders(paths, args[0]);
                        notifyInconInstance(frmInclude.components);
                        Application.Run(frmInclude);
                    }
                    break;

                case "/a":
                    frmAddDigitalSignature frmAdd = new frmAddDigitalSignature(paths, true);
                    notifyInconInstance(frmAdd.components);
                    Application.Run(frmAdd);
                    break;

                default:
                    Application.Exit();
                    break;
                }
            }
        }
        private void btnYes_Click(object sender, EventArgs e)
        {
            switch (actionToPerform)
            {
            case "/r":
                frmSelectDigitalSignatureToRemove FormSelectToRemove = new frmSelectDigitalSignatureToRemove(explorerItens, chkIncludeSubfolders.Checked);
                FormSelectToRemove.Show();
                this.Visible = false;
                break;

            /*
             * frmSelectDigitalSignatureToRemove FormRemove = new frmSelectDigitalSignatureToRemove(explorerItens, chkIncludeSubfolders.Checked);
             * FormRemove.Show();
             * this.Visible = false;
             * break;
             */
            case "/v":
                frmManageDigitalSignature FormManage = new frmManageDigitalSignature(explorerItens, chkIncludeSubfolders.Checked);
                FormManage.Show();
                this.Visible = false;
                break;
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            System.Diagnostics.Debug.Assert(true);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

#if DEBUG
            args    = new string[2];
            args[0] = "/v";
            //args[1] = "D:\\certificado_digital\\new_pdf.pdf";
            //args[1] = "D:\\certificado_digital\\new_word.docx";
            //args[1] = "D:\\certificado_digital\\new_word.docx|D:\\certificado_digital\\new_pdf.pdf";
            //args[1] = "D:\\certificado_digital\\Doc7.docx|D:\\certificado_digital\\Doc7_signed_signed.pdf";
            //args[1] = "D:\\certificado_digital\\new_pdf.pdf|D:\\certificado_digital\\Doc7_signed_signed.pdf";
            //args[1] = "D:\\certificado_digital\\doc_not_signed.docx";
            //args[1] = "D:\\certificado_digital\\doc_not_signed.pdf";
            //args[1] = "D:\\certificado_digital\\doc_not_signed.docx|D:\\certificado_digital\\doc_not_signed.pdf";
            //args[1] = "D:\\certificado_digital\\doc_not_signed.pdf|D:\\certificado_digital\\doc_not_signed.docx";
            //args[1] = "D:\\certificado_digital\\new\\doc.pdf";
            //args[1] = "D:\\certificado_digital";
            args[1] = "D:\\certificado_digital\\new\\doc.docx";
            //args[1] = "D:\\certificado_digital\\new\\doc.pdf|D:\\certificado_digital\\new\\doc.docx";

            /*args[1] =
             *  "D:\\certificado_digital\\Documentos_Assinados\\new_excel.xlsx|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\old_excel.xlsx|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\new_powerpoint.pptx|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\old_powerpoint.pptx|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\new_word.docx|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\old_word.docx|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\new_pdf.pdf|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\old_pdf.pdf|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\new_xps.xps|" +
             *  "D:\\certificado_digital\\Documentos_Assinados\\old_xps.xps";
             */
#endif

            if (args.Length > 0)
            {
                string[] paths = args[1].Split('|');
                switch (args[0])
                {
                case "/v":
                    if ((paths.Length <= 1) && System.IO.Path.HasExtension(paths[0]))
                    {
                        frmManageDigitalSignature frmManage = new frmManageDigitalSignature(paths, false);
                        notifyInconInstance(frmManage.components);
                        Application.Run(frmManage);
                    }
                    else
                    {
                        frmIncludeSubFolders frmInclude = new frmIncludeSubFolders(paths, args[0]);
                        notifyInconInstance(frmInclude.components);
                        Application.Run(frmInclude);
                    }
                    break;

                case "/r":
                    if ((paths.Length <= 1) && System.IO.Path.HasExtension(paths[0]))
                    {
                        frmSelectDigitalSignatureToRemove frmSelect = new frmSelectDigitalSignatureToRemove(paths, false);
                        notifyInconInstance(frmSelect.components);
                        Application.Run(frmSelect);
                    }
                    else
                    {
                        frmIncludeSubFolders frmInclude = new frmIncludeSubFolders(paths, args[0]);
                        notifyInconInstance(frmInclude.components);
                        Application.Run(frmInclude);
                    }
                    break;

                case "/a":
                    frmAddDigitalSignature frmAdd = new frmAddDigitalSignature(paths, true);
                    notifyInconInstance(frmAdd.components);
                    Application.Run(frmAdd);
                    break;

                default:
                    Application.Exit();
                    break;
                }
            }
        }