public IFolder GetFolder(string folderPath) { FolderPathNavigator folderPathNavigator = new FolderPathNavigator(folderPath); MAPIFolder folder = GetFolder(folderPathNavigator); return folder == null ? null : new OutlookFolder(folder); }
public Collection<IEmail> GetEmails(string folderPath) { FolderPathNavigator folderPathNavigator = new FolderPathNavigator(folderPath); MAPIFolder finalFolder = GetFolder(folderPathNavigator); OutlookFolder outlookFolder = new OutlookFolder(finalFolder); return outlookFolder.GetEmails(); }
private MAPIFolder GetFolder(MAPIFolder parentFolder, FolderPathNavigator folderPathNavigator) { if (folderPathNavigator.IsAtLastFolder()) return parentFolder; folderPathNavigator.Next(); foreach (MAPIFolder folder in parentFolder.Folders) { if (folder.FullFolderPath == folderPathNavigator.CurrentFolderPath) { return GetFolder(folder, folderPathNavigator); } } return null; }
private MAPIFolder GetFolder(FolderPathNavigator folderPathNavigator) { Folders folders = OutlookNameSpace.Folders; MAPIFolder obtainedFolder = null; foreach (MAPIFolder folder in folders) { if (folder.FullFolderPath == folderPathNavigator.CurrentFolderPath) { obtainedFolder = GetFolder(folder, folderPathNavigator); } } return obtainedFolder; }