private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { if (e.Exception is Exception ex) { LogStatic.Exception(ex); } else { LogStatic.Message("an empty DispatcherUnhandledException was thrown"); } }
/// <summary> /// 将关系型数据转化成领域对象 /// </summary> /// <param name="dr">关系型数据对象</param> /// <returns>领域对象实例</returns> public LogStatic ConvertToLogStaticDomain(DataRow dr) { if (null == dr) { throw new ArgumentNullException("dr"); } LogStatic logStatic = new LogStatic(); logStatic.ServiceName = dr["ServiceName"].ToString(); logStatic.ClassName = dr["ClassName"].ToString(); logStatic.ErrorCount = Convert.ToUInt32(dr["ErrorCount"]); return(logStatic); }
public static int Main() { App app = new App(); int exitCode = app.Run(); if (exitCode != 0) { string message = string.Format(CultureInfo.CurrentCulture, "exited with code {0}", exitCode); LogStatic.Message(message); } return(exitCode); }