protected override void InternalProcessRecord() { try { if (this.Path != null) { PublicFolder publicFolder = (PublicFolder)base.GetDataObject <PublicFolder>(this.Path, base.DataSession, null, new LocalizedString?(Strings.ErrorPublicFolderNotFound(this.Path.ToString())), new LocalizedString?(Strings.ErrorPublicFolderNotUnique(this.Path.ToString()))); using (this.publicFolderDataProvider.PublicFolderSession.GetRestrictedOperationToken()) { using (CoreFolder coreFolder = CoreFolder.Bind(this.publicFolderDataProvider.PublicFolderSession, publicFolder.InternalFolderIdentity.ObjectId)) { coreFolder.MoveFolder(coreFolder, this.DataObject.InternalFolderIdentity.ObjectId); this.folderUpdated = true; } } } if (this.OverrideContentMailbox != null && (this.Force || base.ShouldContinue(Strings.ConfirmationMessageOverrideContentMailbox))) { PublicFolder publicFolder2 = (PublicFolder)base.GetDataObject <PublicFolder>(this.Identity, base.DataSession, null, new LocalizedString?(Strings.ErrorPublicFolderNotFound(this.Identity.ToString())), new LocalizedString?(Strings.ErrorPublicFolderNotUnique(this.Identity.ToString()))); using (this.publicFolderDataProvider.PublicFolderSession.GetRestrictedOperationToken()) { using (CoreFolder coreFolder2 = CoreFolder.Bind(this.publicFolderDataProvider.PublicFolderSession, publicFolder2.InternalFolderIdentity.ObjectId)) { coreFolder2.PropertyBag.SetProperty(CoreFolderSchema.ReplicaList, new string[] { this.contentMailboxGuid.ToString() }); coreFolder2.PropertyBag.SetProperty(CoreFolderSchema.LastMovedTimeStamp, ExDateTime.UtcNow); coreFolder2.Save(SaveMode.NoConflictResolution); this.folderUpdated = true; } } } base.InternalProcessRecord(); } catch (NotSupportedException exception) { base.WriteError(exception, ErrorCategory.InvalidType, this.Identity); } }
void IDestinationMailbox.MoveFolder(byte[] folderId, byte[] oldParentId, byte[] newParentId) { MrsTracer.Provider.Function("StorageDestinationMailbox.MoveFolder", new object[0]); base.VerifyMailboxConnection(VerifyMailboxConnectionFlags.None); using (base.RHTracker.Start()) { using (CoreFolder coreFolder = CoreFolder.Bind(base.StoreSession, base.GetFolderId(oldParentId))) { using (CoreFolder coreFolder2 = CoreFolder.Bind(base.StoreSession, base.GetFolderId(newParentId))) { GroupOperationResult groupOperationResult = coreFolder.MoveFolder(coreFolder2, StoreObjectId.FromProviderSpecificId(folderId)); if (groupOperationResult.OperationResult != OperationResult.Succeeded) { MrsTracer.Provider.Error("StorageDestinationMailbox.MoveFolder failed with {0}", new object[] { groupOperationResult.Exception.ToString() }); groupOperationResult.Exception.PreserveExceptionStack(); throw groupOperationResult.Exception; } } } } }