/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ThisAddIn_Startup(object sender, System.EventArgs e) { try { if (null == g_log) { g_log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); } ThisAddIn.g_log.Info("startup begin"); //读取账号信息 if (ThisAddIn.g_AccountInfo == null) { ThisAddIn.g_AccountInfo = new AccountInfoClass(); } ThisAddIn.g_AccountInfo.ReadAccountInfo(); //读取系统参数和设置信息 if (ThisAddIn.g_SystemSettings == null) { ThisAddIn.g_SystemSettings = new SystemSettingsClass(); } ThisAddIn.g_SystemSettings.ReadSystemSetting(); ThisAddIn.g_log.Info("startup end"); } catch (System.Exception ex) { ThisAddIn.g_log.Error(ex.Message); MessageBox.Show(ex.Message); } finally { //重定向ItemSend事件 this.Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookItemSend); this.Application.Inspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector); } Update(); }
private void ThisAddIn_Startup(object sender, System.EventArgs e) { try { if (g_log == null) { g_log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); } ThisAddIn.g_log.Info("startup begin"); ////语言,帮助文档加载 //LoadManager.loadOfficeLanguage(); LoadManager.loadHelpFiles(); ////工具栏管理 //RemoveMenubar(); //AddMenuBar(); //读取账号信息 if (ThisAddIn.g_AccountInfo == null) { ThisAddIn.g_AccountInfo = LoadManager.loadAccountInfo(); } //读取系统参数和设置信息 if (ThisAddIn.g_SystemSettings == null) { ThisAddIn.g_SystemSettings = LoadManager.loadSystemSetting(); } ThisAddIn.g_log.Info("startup end"); } catch (System.Exception ex) { ThisAddIn.g_log.Error(ex.Message); MessageBox.Show(ex.Message); } finally { tp_Loaded = true; //重定向ItemSend事件 this.Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookItemSend); this.Application.Inspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector); } UpdateManager.Update(); }