private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { siteCollectionUrl = tbxSiteCollectionAddress.Text; oldDomainName = tbxOldDomainName.Text; newDomainName = tbxNewDomainName.Text; ignorySidHistory = rbYes.Checked; var migrationUtilityRequest = new DomainUsersMigrationRequest { EnforceSidHistory = ignorySidHistory, SiteCollectionUrl = siteCollectionUrl, OldDomainName = oldDomainName, NewDomainName = newDomainName }; utility = new DomainUsersMigrationUtility(migrationUtilityRequest); utility.Start(); }
public frmResult(DomainUsersMigrationUtility utility) { InitializeComponent(); lblMigratedUsers.Visible = false; lblTotalUsers.Visible = false; lblSkipedUsers.Visible = false; btnSaveProcessMessages.Visible = false; this.utility = utility; lblMigratedUsers.Visible = true; lblTotalUsers.Visible = true; lblSkipedUsers.Visible = true; btnSaveProcessMessages.Visible = true; lblMigratedUsers.Text = string.Format("Migrated Users: {0}", utility.MigratedUsers); lblTotalUsers.Text = string.Format("Total Users: {0}", utility.TotalUsers); lblSkipedUsers.Text = string.Format("Skiped Users: {0}", utility.SkipedUsers); pictureBox1.Image = utility.MigratedUsers > 0 ? Image.FromFile("Images/Information.png") : Image.FromFile("Images/Error.png"); pictureBox1.Width = pictureBox1.Image.Width; pictureBox1.Height = pictureBox1.Image.Height; pictureBox1.BackColor = Color.Transparent; }