public override void RestoreItem(string mailbox, IRestoreItemInformation item) { bool isFinish = false; RestoreStart(); try { RestoreServiceObj.RestoreItem(mailbox, item); isFinish = true; } finally { RestoreEnd(isFinish); } }
public virtual void RestoreItem(string mailbox, IRestoreItemInformation item) { IItemData itemDetails = DataAccess.GetItemContent(item.ItemId, item.DisplayName, Destination.ExportType); Destination.WriteItem(item, itemDetails.Data as byte[]); }
private void WriteItemForEachType(IRestoreItemInformation item, byte[] itemData) { string folderId; ConnectMailbox(DesMailboxAddress); switch (item.ItemClass) { case DataProtectInterface.Util.ItemClass.Message: { List<IFolderDataBase> path = GetFolderPathArray(item.FolderPathes); var folder = EwsAdapter.CreateFoldersIfNotExist(path); folderId = folder; break; } case DataProtectInterface.Util.ItemClass.Contact: { folderId = EwsAdapter.GetContactFolderId(); break; } case DataProtectInterface.Util.ItemClass.Appointment: { folderId = EwsAdapter.GetAppointmentFolderId(); break; } case DataProtectInterface.Util.ItemClass.Task: { folderId = EwsAdapter.GetTaskFolderId(); break; } default: throw new NotSupportedException("Can not import not support itemclass."); } var argument = _argument; EwsAdapter.ImportItem(folderId, itemData, argument); }
private void WriteItemToDesFolder(IRestoreItemInformation item, byte[] itemData) { ConnectMailbox(DesMailboxAddress); List<IFolderDataBase> path = GetFolderPathArray(item.FolderPathes); var folderId = EwsAdapter.CreateFoldersIfNotExist(path); var argument = _argument; EwsAdapter.ImportItem(folderId, itemData, argument); }
public void WriteItem(IRestoreItemInformation item, byte[] itemData) { //WriteItemForEachType(item, itemData); WriteItemToDesFolder(item, itemData); }