private void OnMigrateAccount(object o, EventArgs args) { TreeSelection tSelect = AccTreeView.Selection; if (tSelect.CountSelectedRows() == 1) { TreeModel tModel; TreeIter iter; tSelect.GetSelected(out tModel, out iter); // string id = (string) tModel.GetValue(iter, 0); MigrationWizard migratewiz = null; //new MigrationWizard(GetName(id), GetHomeLocation(id), ifws, this); migratewiz.TransientFor = topLevelWindow; if (!Util.RegisterModalWindow(migratewiz)) { try { Util.CurrentModalWindow.Present(); } catch {} migratewiz.Destroy(); return; } migratewiz.ShowAll(); /* * if(curDomains.Count == 0) * { * this.Hide(); * this.Destroy(); * } */ } }
private void OnMigrateAccount(object o, EventArgs args) { TreeSelection tSelect = AccTreeView.Selection; if (tSelect.CountSelectedRows() == 1) { TreeModel tModel; TreeIter iter; tSelect.GetSelected(out tModel, out iter); string id = (string)tModel.GetValue(iter, 0); string status = GetEncryptionStatus(id); bool stat = false;; if (status == null) { stat = false; } else if (status == "BLWF") { stat = true; } else { stat = false; } MigrationWizard migratewiz = new MigrationWizard(GetName(id), GetHomeLocation(id), ifws, simws, this, stat); // migratewiz.TransientFor = topLevelWindow; if (!Util.RegisterModalWindow(migratewiz)) { try { Util.CurrentModalWindow.Present(); } catch {} migratewiz.Destroy(); return; } migratewiz.ShowAll(); } }
/// <summary> /// Event Handler for Migrate Button click event /// </summary> private void btnMigrate_Click(object sender, System.EventArgs e) { ListViewItem lvi = this.listView1.SelectedItems[0]; if (lvi == null) { return; } bool encr = false; if (lvi.SubItems[2].Text == Resource.GetString("Encrypted")) { encr = true; } if (this.Merge == true) { // Merege with the iFolder selected... this.iFolderLocation = lvi.SubItems[1].Text; this.UserName = lvi.SubItems[0].Text; DirectoryInfo dir = new DirectoryInfo(this.iFolderLocation); if (dir.Exists == false) { System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(GlobalProperties)); MyMessageBox mmb = new MyMessageBox(resManager.GetString("FolderDoesNotExistError"), resManager.GetString("FolderDoesNotExistErrorTitle"), resManager.GetString("FolderDoesNotExistErrorDesc"), MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); this.iFolderLocation = null; } else if (dir.Exists && dir.Name.Equals(this.iFolderName, StringComparison.CurrentCultureIgnoreCase) == false /*dir.Name != this.iFolderName*/) { // Prompt for the Rename of the iFolder... MyMessageBox mmb = new MyMessageBox(Resource.GetString("MigrationRenamePrompt.Text"), Resource.GetString("MigrationAlert"), "", MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question); DialogResult res = mmb.ShowDialog(); if (res == DialogResult.Yes) { try { dir.MoveTo(Path.Combine(dir.Parent.FullName, this.iFolderName)); this.iFolderLocation = Path.Combine(dir.Parent.FullName, this.iFolderName); } catch (Exception ex) { /// Unable to rename... MyMessageBox mmb1 = new MyMessageBox("Unable to rename the selected location.", "Migration Alert", ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb1.ShowDialog(); this.iFolderLocation = null; this.UserName = null; return; } } else { this.iFolderLocation = null; this.UserName = null; return; } } else if (dir.Name.Equals(this.iFolderName, StringComparison.CurrentCultureIgnoreCase)) { this.iFolderLocation = Path.Combine(dir.Parent.FullName, this.iFolderName); } this.Dispose(true); return; } MigrationWizard migrationWizard = new MigrationWizard(lvi.SubItems[0].Text, lvi.SubItems[1].Text, encr, ifWebService, this.simiasWebService); // accountWizard.EnterpriseConnect += new Novell.Wizard.AccountWizard.EnterpriseConnectDelegate(accountWizard_EnterpriseConnect); if (migrationWizard.ShowDialog() == DialogResult.OK) { /* * // Display the iFolders dialog. * if ( DisplayiFolderDialog != null ) * { * DisplayiFolderDialog( this, new EventArgs() ); * } */ } migrationWizard.Dispose(); AddMigrationDetails(); }