Esempio n. 1
0
 public KeyRecoveryWizard(iFolderWebService ifWebService, SimiasWebService simiasWebService,Manager simiasManager)
 {
     this.simiasWebService = simiasWebService;
     this.ifWebService = ifWebService;
     this.simiasManager = simiasManager;
     InitializeComponent();
     this.domainSelectionPage = new DomainSelectionPage(this.ifWebService,this.simiasWebService);
     this.enterPassphrasePage = new EnterPassphrasePage(this.ifWebService,this.simiasWebService,this.simiasManager);
     this.infoPage = new InfoPage();
     this.selectionPage = new SelectionPage();
     this.singleWizPage = new SinglePageWizard(this.ifWebService, this.simiasWebService);
     this.importKeyPage = new ImportKeyPage(this.ifWebService, this.simiasWebService);
     this.finalPage = new FinalPage();
     this.exportKeyPage = new ExportKeyPage(this.ifWebService, this.simiasWebService);
     this.emailPage = new EmailPage();
     this.domainSelectionPage.HeaderTitle = TrayApp.Properties.Resources.domainSelectionPageTitle;
     this.domainSelectionPage.Location = new System.Drawing.Point(0, 0);
     this.domainSelectionPage.Name = TrayApp.Properties.Resources.domainSelectionPageName;
     this.domainSelectionPage.Size = new System.Drawing.Size(496, 304);
     this.domainSelectionPage.TabIndex = 1;
     this.enterPassphrasePage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle;
     this.enterPassphrasePage.Location = new System.Drawing.Point(0, 0);
     this.enterPassphrasePage.Name = TrayApp.Properties.Resources.enterPassphrasePageName;
     this.enterPassphrasePage.Size = new System.Drawing.Size(496, 304);
     this.enterPassphrasePage.TabIndex = 1;
     this.infoPage.HeaderTitle = TrayApp.Properties.Resources.infoPageTitle;
     this.infoPage.Location = new System.Drawing.Point(0, 0);
     this.infoPage.Name = TrayApp.Properties.Resources.infoPageName;
     this.infoPage.Size = new System.Drawing.Size(496, 304);
     this.infoPage.TabIndex = 1;
     this.selectionPage.HeaderTitle = TrayApp.Properties.Resources.selectionPageTitle;
     this.selectionPage.Location = new System.Drawing.Point(0, 0);
     this.selectionPage.Name = TrayApp.Properties.Resources.selectionPageName;
     this.selectionPage.Size = new System.Drawing.Size(496, 304);
     this.selectionPage.TabIndex = 1;
     this.singleWizPage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle;
     this.singleWizPage.Location = new System.Drawing.Point(0, 0);
     this.singleWizPage.Name = TrayApp.Properties.Resources.singleWizPageName;
     this.singleWizPage.Size = new System.Drawing.Size(496, 304);
     this.singleWizPage.TabIndex = 1;
     this.importKeyPage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle;
     this.importKeyPage.Location = new System.Drawing.Point(0, 0);
     this.importKeyPage.Name = TrayApp.Properties.Resources.importPageName;
     this.importKeyPage.Size = new System.Drawing.Size(496, 304);
     this.importKeyPage.TabIndex = 1;
     this.finalPage.HeaderTitle = TrayApp.Properties.Resources.finalPageTitle;
     this.finalPage.Location = new System.Drawing.Point(0, 0);
     this.finalPage.Name = TrayApp.Properties.Resources.finalPageName;
     this.finalPage.Size = new System.Drawing.Size(496, 304);
     this.finalPage.TabIndex = 1;
     this.exportKeyPage.HeaderTitle = TrayApp.Properties.Resources.exportPageTitle;
     this.exportKeyPage.Location = new System.Drawing.Point(0, 0);
     this.exportKeyPage.Name = TrayApp.Properties.Resources.exportPageName;
     this.exportKeyPage.Size = new System.Drawing.Size(496, 304);
     this.exportKeyPage.TabIndex = 1;
     this.emailPage.HeaderTitle = TrayApp.Properties.Resources.emailPageTitle;
     this.emailPage.Location = new System.Drawing.Point(0, 0);
     this.emailPage.Name = TrayApp.Properties.Resources.emailPageName;
     this.emailPage.Size = new System.Drawing.Size(496, 304);
     this.emailPage.TabIndex = 1;
     this.Controls.Add(this.domainSelectionPage);
     this.Controls.Add(this.enterPassphrasePage);
     this.Controls.Add(this.infoPage);
     this.Controls.Add(this.selectionPage);
     this.Controls.Add(this.singleWizPage);
     this.Controls.Add(this.importKeyPage);
     this.Controls.Add(this.finalPage);
     this.Controls.Add(this.exportKeyPage);
     this.Controls.Add(this.emailPage);
     this.BackColor = System.Drawing.Color.Gainsboro;
     try
     {
         this.Icon = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico"));
     }
     catch { }
     pages = new BaseWizardPage[maxPages];
     pages[0] = this.domainSelectionPage;
     pages[1] = this.enterPassphrasePage;
     pages[2] = this.infoPage;
     pages[3] = this.selectionPage;
     pages[4] = this.singleWizPage;
     pages[5] = this.importKeyPage;
     pages[6] = this.finalPage;
     pages[7] = this.exportKeyPage;
     pages[8] = this.emailPage;
     try
     {
         Image image = Image.FromFile(System.IO.Path.Combine(Application.StartupPath, @"res\ifolder48.png"));
         this.domainSelectionPage.Thumbnail = image;
         this.enterPassphrasePage.Thumbnail = image;
         this.infoPage.Thumbnail = image;
         this.selectionPage.Thumbnail = image;
         this.singleWizPage.Thumbnail = image;
         this.importKeyPage.Thumbnail = image;
         this.finalPage.Thumbnail = image;
         this.exportKeyPage.Thumbnail = image;
         this.emailPage.Thumbnail = image;
     }
     catch { }
     foreach (BaseWizardPage page in pages)
     {
         page.Hide();
     }
     bool result = GetLoggedInDomains();
     if(result == true)
         domainSelectionPage.ActivatePage(0);
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a KeyRecoveryWizard object with the member pages
        /// </summary>
        /// <param name="ifWebService">iFolderwebservice</param>
        /// <param name="simiasWebService">simiasWebService</param>
        public KeyRecoveryWizard(iFolderWebService ifWebService, SimiasWebService simiasWebService, Manager simiasManager)
        {
            this.simiasWebService = simiasWebService;
            this.ifWebService     = ifWebService;
            this.simiasManager    = simiasManager;

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Initialize the wizard pages

            this.domainSelectionPage = new DomainSelectionPage(this.ifWebService, this.simiasWebService);

            this.enterPassphrasePage = new EnterPassphrasePage(this.ifWebService, this.simiasWebService, this.simiasManager);


            this.infoPage      = new InfoPage();
            this.selectionPage = new SelectionPage();


            //selection 1 = have all parameters to do things
            this.singleWizPage = new SinglePageWizard(this.ifWebService, this.simiasWebService);

            //selection 2 = have only decrypted file sent by admin
            this.importKeyPage = new ImportKeyPage(this.ifWebService, this.simiasWebService);

            this.finalPage = new FinalPage();//successfully reset passphrase

            //selection 3= have nothing
            this.exportKeyPage = new ExportKeyPage(this.ifWebService, this.simiasWebService);

            this.emailPage = new EmailPage();

            //domainSelectionPage

            this.domainSelectionPage.HeaderTitle = TrayApp.Properties.Resources.domainSelectionPageTitle;
            this.domainSelectionPage.Location    = new System.Drawing.Point(0, 0);
            this.domainSelectionPage.Name        = TrayApp.Properties.Resources.domainSelectionPageName;
            this.domainSelectionPage.Size        = new System.Drawing.Size(496, 304);
            this.domainSelectionPage.TabIndex    = 1;

            //enterpassphrasepage

            this.enterPassphrasePage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle;
            this.enterPassphrasePage.Location    = new System.Drawing.Point(0, 0);
            this.enterPassphrasePage.Name        = TrayApp.Properties.Resources.enterPassphrasePageName;
            this.enterPassphrasePage.Size        = new System.Drawing.Size(496, 304);
            this.enterPassphrasePage.TabIndex    = 1;



            //infoPage
            this.infoPage.HeaderTitle = TrayApp.Properties.Resources.infoPageTitle; // "Welcome to the Passphrase Recovery Wizard";
            this.infoPage.Location    = new System.Drawing.Point(0, 0);
            this.infoPage.Name        = TrayApp.Properties.Resources.infoPageName;
            this.infoPage.Size        = new System.Drawing.Size(496, 304);
            this.infoPage.TabIndex    = 1;

            //selectionPage
            this.selectionPage.HeaderTitle = TrayApp.Properties.Resources.selectionPageTitle; // "Select Passphrase Recovery step";
            this.selectionPage.Location    = new System.Drawing.Point(0, 0);
            this.selectionPage.Name        = TrayApp.Properties.Resources.selectionPageName;  // "keyRecoverySelectionPage";
            this.selectionPage.Size        = new System.Drawing.Size(496, 304);
            this.selectionPage.TabIndex    = 1;

            //singlewizpage
            this.singleWizPage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle; // "Set New Passphrase";
            this.singleWizPage.Location    = new System.Drawing.Point(0, 0);
            this.singleWizPage.Name        = TrayApp.Properties.Resources.singleWizPageName;     // "keyRecoverySingleWizPage";
            this.singleWizPage.Size        = new System.Drawing.Size(496, 304);
            this.singleWizPage.TabIndex    = 1;


            //importKeyPage
            this.importKeyPage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle;//"Resetting Passphrase Using Decrypted Key File";
            this.importKeyPage.Location    = new System.Drawing.Point(0, 0);
            this.importKeyPage.Name        = TrayApp.Properties.Resources.importPageName;
            this.importKeyPage.Size        = new System.Drawing.Size(496, 304);
            this.importKeyPage.TabIndex    = 1;

            //finalPage
            this.finalPage.HeaderTitle = TrayApp.Properties.Resources.finalPageTitle; // "Passphrase is reset successfully.";
            this.finalPage.Location    = new System.Drawing.Point(0, 0);
            this.finalPage.Name        = TrayApp.Properties.Resources.finalPageName;  // "finalPage";
            this.finalPage.Size        = new System.Drawing.Size(496, 304);
            this.finalPage.TabIndex    = 1;

            // exportKeyPage
            this.exportKeyPage.HeaderTitle = TrayApp.Properties.Resources.exportPageTitle; // "Export Key File from the Server";
            this.exportKeyPage.Location    = new System.Drawing.Point(0, 0);
            this.exportKeyPage.Name        = TrayApp.Properties.Resources.exportPageName;  //"keyRecoveryExportKeyPage";
            this.exportKeyPage.Size        = new System.Drawing.Size(496, 304);
            this.exportKeyPage.TabIndex    = 1;
            //
            // emailPage
            this.emailPage.HeaderTitle = TrayApp.Properties.Resources.emailPageTitle; //"Export of Key file Successful";
            this.emailPage.Location    = new System.Drawing.Point(0, 0);
            this.emailPage.Name        = TrayApp.Properties.Resources.emailPageName;  //"keyrecoverySuccessPage";
            this.emailPage.Size        = new System.Drawing.Size(496, 304);
            this.emailPage.TabIndex    = 1;

            //Add member pages to wizard
            this.Controls.Add(this.domainSelectionPage);
            this.Controls.Add(this.enterPassphrasePage);
            this.Controls.Add(this.infoPage);
            this.Controls.Add(this.selectionPage);
            this.Controls.Add(this.singleWizPage);
            this.Controls.Add(this.importKeyPage);
            this.Controls.Add(this.finalPage);
            this.Controls.Add(this.exportKeyPage);
            this.Controls.Add(this.emailPage);
            this.BackColor = System.Drawing.Color.Gainsboro;


            // Load the application icon.
            try
            {
                this.Icon = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico"));
            }
            catch { } // Ignore

            // Put the wizard pages in order.
            pages    = new BaseWizardPage[maxPages];
            pages[0] = this.domainSelectionPage;
            pages[1] = this.enterPassphrasePage;
            pages[2] = this.infoPage;
            pages[3] = this.selectionPage;
            pages[4] = this.singleWizPage;
            pages[5] = this.importKeyPage;
            pages[6] = this.finalPage;
            pages[7] = this.exportKeyPage;
            pages[8] = this.emailPage;

            try
            {
                Image image = Image.FromFile(System.IO.Path.Combine(Application.StartupPath, @"res\ifolder48.png"));
                this.domainSelectionPage.Thumbnail = image;
                this.enterPassphrasePage.Thumbnail = image;
                this.infoPage.Thumbnail            = image;
                this.selectionPage.Thumbnail       = image;
                this.singleWizPage.Thumbnail       = image;
                this.importKeyPage.Thumbnail       = image;
                this.finalPage.Thumbnail           = image;
                this.exportKeyPage.Thumbnail       = image;
                this.emailPage.Thumbnail           = image;
            }
            catch { } // Ignore. Unable to load watermark. No functionality issues

            foreach (BaseWizardPage page in pages)
            {
                page.Hide();
            }

            // Activate the first wizard page.
            //pages[0].ActivatePage(0);
            bool result = GetLoggedInDomains();

            if (result == true)
            {
                domainSelectionPage.ActivatePage(0);
            }
        }