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.LogTaskMessage(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.LogTaskWarning(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.LogTaskMessage("    - " + infoMessage.Message);
             }
         }
     }
 }
 private void TraceMessageEventHandler(object sender, SqlInfoMessageEventArgs e)
 {
     if (this.ScriptFileExecuted != null)
     {
         ExecuteEventArgs args = new ExecuteEventArgs(e.Errors);
         this.ScriptFileExecuted(null, args);
     }
 }