Exemplo n.º 1
0
 private void outputExceptions(InterpretException[] exceptions)
 {
     string exceptionText = "";
     for (int i=0;i<exceptions.Length;i++){
         exceptionText += "Zeile " + exceptions[i].exceptionLine + ": ";
         switch (exceptions[i].result){
             case InterpretResult.IdentifierNotFound:
                 exceptionText += "Der verwendete Identifizierer konnte nich zugeordnet werden." + "\r\n";
                 break;
             case InterpretResult.InstanceNotFound:
                 exceptionText += "Der verwendete Instanzidentifizierer konnte nich zugeordnet werden." + "\r\n";
                 break;
             case InterpretResult.LineAllreadyExists:
                 exceptionText += "Es existiert bereits eine nicht abgeschlossene Linie für diese Instanz." + "\r\n";
                 break;
             case InterpretResult.LineNotExists:
                 exceptionText += "Es existiert keine offene Linie für diese Instanz." + "\r\n";
                 break;
             case InterpretResult.ParameterOutOfRange:
                 exceptionText += "Der Parameter " + exceptions[i].exceptionParameter + " ist außerhalb des gültigen Bereichs." + "\r\n";
                 break;
             case InterpretResult.UnknownCommand:
                 exceptionText += "Unbekannter Befehl " + exceptions[i].exceptionCommand + "\r\n";
                 break;
             case InterpretResult.UnknownParameter:
                 exceptionText += "Unbekannter Parameter " + exceptions[i].exceptionParameter + "\r\n";
                 break;
             case InterpretResult.WrongParameterNumber:
                 exceptionText += "Falsche Parameteranzahl. Der Befehl  " + exceptions[i].exceptionCommand + " benötigt mindestens " + exceptions[i].exceptionParameter + " Parameter." + "\r\n";
                 break;
         }
     }
     this.txtLog.Text = exceptionText;
 }
Exemplo n.º 2
0
 public Log(InterpretException[] exceptionList)
 {
     InitializeComponent();
     OwenInitialize();
     this.outputExceptions(exceptionList);
 }
Exemplo n.º 3
0
 public void WriteLog(InterpretException[] results)
 {
     string exceptionText = "";
     System.GC.Collect();
     if (results == null) {						// no errors were found
         if (log != null) {
             if (!log.IsDisposed) {				// if log window is visible
                 log.ClearLogText();				// clear old log text
             }
         }
     } else {										// errors were found
         if (log == null) {						// create new log window if necessery
             log = new Log(this);
         }
         if (log.IsDisposed) {
             log = new Log(this);
         }
         log.Icon = (System.Drawing.Icon)(resources.GetObject("logIcon"));
         log.ClearLogText();
         log.Show();
         log.WindowState = System.Windows.Forms.FormWindowState.Normal;
         for (int i = 0; i < results.Length; i++) {			// write errors to log
             exceptionText = results[i].Message;
             log.AppendLogText(LogIcon.Note, (int)results[i].exceptionLine, exceptionText);
         }
         log.BringToFront();// show log window in front
     }
 }