private void IniFile__OnFileChanged(object sender, EventArgs _) { try { if (iniFile_ == null) { return; } var sendCrashReport = iniFile_.ReadEnableCrashReport(); MicrosoftAppCenter.EnableSendCrashReport = sendCrashReport; context_?.server?.EnableSendCrashReport(Convert.ToSByte(sendCrashReport)); } catch (System.Exception e) { logger_?.Error(e.ToString()); } }
public bool Initialize(string iniFileName) { //Memo: logger_はBackEndService起動後に取得可能 try { iniFile_ = IniFileService.Create(iniFileName); if (iniFile_ == null) { logger_?.Error(string.Format(".Ini file not found. iniFilename={0}", iniFileName)); return(false); } //CrashReport送信は個人情報に関わる処理なので処理の早い段階で真偽値をセットする MicrosoftAppCenter.EnableSendCrashReport = iniFile_.ReadEnableCrashReport(); iniFile_.OnFileChanged += IniFile__OnFileChanged; return(true); }catch (Exception e) { HmOutputPane.OutputW(Hidemaru.Hidemaru_GetCurrentWindowHandle(), e.ToString()); logger_?.Error(e.ToString()); } return(false); }