示例#1
0
 /// <summary>
 /// Opens a file by creating a new NetworkTrace object using provided path.
 /// </summary>
 /// <param name="file">File path to open</param>
 private void OpenFile(string file)
 {
     SetStatusText("Processing " + file);
     try
     {
         NetworkTrace newTrace = new NetworkTrace(file, Filter);
         if (!shutdown && newTrace != null && (!Options.ErrorOnly || newTrace.HasError))
         {
             lock (traceSync)
             {
                 traces.Add(newTrace);
             }
         }
         else
         {
             // If we're not going to keep the trace, Dispose it.  This cleans up event handlers that rooted the object.
             newTrace.Dispose();
         }
     }
     finally
     {
         // Regardless of success or failure, increment our progress and output a new status message.
         Interlocked.Increment(ref currentProgress);
         SetStatusText("Processed " + file);
     }
 }