private void OnScriptFileExecuted(ExecuteEventArgs scriptFileExecuted) { if (scriptFileExecuted != null && this.ScriptFileExecuted != null) { this.ScriptFileExecuted(null, scriptFileExecuted); } }
private void ScriptExecuted(object sender, ExecuteEventArgs scriptInfo) { if (scriptInfo.ScriptFileInfo != null) { if (scriptInfo.Succeeded) { TimeSpan s = DateTime.Now - this.timer; this.LogBuildMessage(string.Format(CultureInfo.CurrentCulture, "Successfully executed: {0} ({1} seconds)", scriptInfo.ScriptFileInfo.Name, s.TotalSeconds)); this.timer = DateTime.Now; } else { TimeSpan s = DateTime.Now - this.timer; this.LogBuildWarning(string.Format(CultureInfo.CurrentCulture, "Failed to executed: {0}. {1} ({2} seconds)", scriptInfo.ScriptFileInfo.Name, scriptInfo.ExecutionException.Message, s.TotalSeconds)); this.timer = DateTime.Now; } } else { if (scriptInfo.SqlInfo != null) { foreach (SqlError infoMessage in scriptInfo.SqlInfo) { this.LogBuildMessage(" - " + infoMessage.Message); } } } }
private void TraceMessageEventHandler(object sender, SqlInfoMessageEventArgs e) { if (this.ScriptFileExecuted != null) { ExecuteEventArgs args = new ExecuteEventArgs(e.Errors); this.ScriptFileExecuted(null, args); } }