protected override void InternalStateReset() { base.InternalStateReset(); SmtpAddress windowsLiveID = this.DataObject.WindowsLiveID; NetID netID = this.DataObject.NetID; string name = this.DataObject.Name; string displayName = this.DataObject.DisplayName; this.DataObject = SoftDeletedTaskHelper.GetSoftDeletedADUser(base.CurrentOrganizationId, this.SoftDeletedObject, new Task.ErrorLoggerDelegate(base.WriteError)); if (this.DataObject.WindowsLiveID != windowsLiveID) { this.DataObject.EmailAddressPolicyEnabled = false; this.DataObject.WindowsLiveID = windowsLiveID; this.DataObject.UserPrincipalName = windowsLiveID.ToString(); this.DataObject.PrimarySmtpAddress = windowsLiveID; } if (this.DataObject.NetID != netID) { this.DataObject.NetID = netID; } if (!string.IsNullOrEmpty(name)) { this.DataObject.Name = name; } this.DataObject.Name = SoftDeletedTaskHelper.GetUniqueNameForRecovery((IRecipientSession)base.DataSession, this.DataObject.Name, this.DataObject.Id); if (!string.IsNullOrEmpty(displayName)) { this.DataObject.DisplayName = displayName; } }
protected override void InternalStateReset() { base.InternalStateReset(); string name = this.DataObject.Name; string displayName = this.DataObject.DisplayName; this.DataObject = SoftDeletedTaskHelper.GetSoftDeletedADUser(base.CurrentOrganizationId, this.SoftDeletedObject, new Task.ErrorLoggerDelegate(base.WriteError)); this.previousExchangeVersion = this.DataObject.ExchangeVersion; this.DataObject.SetExchangeVersion(ADRecipientSchema.WhenSoftDeleted.VersionAdded); if (this.WindowsLiveID != null && this.WindowsLiveID.SmtpAddress != SmtpAddress.Empty && this.WindowsLiveID.SmtpAddress != this.DataObject.WindowsLiveID) { this.DataObject.EmailAddressPolicyEnabled = false; this.DataObject.WindowsLiveID = this.WindowsLiveID.SmtpAddress; this.DataObject.UserPrincipalName = this.WindowsLiveID.SmtpAddress.ToString(); this.DataObject.PrimarySmtpAddress = this.WindowsLiveID.SmtpAddress; } if (!string.IsNullOrEmpty(name)) { this.DataObject.Name = name; } this.DataObject.Name = SoftDeletedTaskHelper.GetUniqueNameForRecovery((IRecipientSession)base.DataSession, this.DataObject.Name, this.DataObject.Id); if (!string.IsNullOrEmpty(displayName)) { this.DataObject.DisplayName = displayName; } }