public void Process(Outlook.MailItem item) { try { FormFolders frm = new FormFolders() { EmailItem = item }; frm.ShowDialog(ThisAddIn.OwnerWindow); if (!frm.IsDisposed) { if (frm.ShowLogin) { frm.Close(); //frm.ShowLogin = false; FormLogin frmLogin = new FormLogin(); frmLogin.ShowDialog(ThisAddIn.OwnerWindow); var info = Option.GetUserInfo(); if (info != null) { Process(item); } } } } catch (Exception ex) { LogClass.WriteException(ex.Message, ex.StackTrace, ex.InnerException == null ? "" : ex.InnerException.Message); } }
public OutlookMonitor() { try { currentExplorer = Application.ActiveExplorer(); currentExplorer.SelectionChange += CurrentExplorer_SelectionChange; } catch (Exception ex) { LogClass.WriteException(ex.Message, ex.StackTrace, ex.InnerException == null ? "" : ex.InnerException.Message); } }
public void DeleteFolders(List <string> paths) { try { foreach (string path in paths) { File.Delete(path); } } catch (Exception ex) { LogClass.WriteException(ex.Message, ex.StackTrace, ex.InnerException == null ? "" : ex.InnerException.Message); } }
private void CurrentExplorer_SelectionChange() { try { ReleaseEmail(); if (Application.ActiveExplorer().Selection.Count > 0) { var item = Application.ActiveExplorer().Selection[1]; if (item is Outlook.MailItem) { LastEmailItem = item; } } } catch (Exception ex) { LogClass.WriteException(ex.Message, ex.StackTrace, ex.InnerException == null ? "" : ex.InnerException.Message); } }