示例#1
0
 protected virtual void OnLogLoaded(LogLoadedCancelEventArgs e)
 {
     if (LogLoaded != null)
     {
         LogLoaded(this, e);
     }
 }
示例#2
0
        private void StartRead()
        {
            this.trigger.WaitOne();
            this.InitializeLoading();

            using (StreamReader reader = new StreamReader(loggerDir))
            {
                String line = String.Empty;
                while ((line = reader.ReadLine()) != null)
                {
                    if (String.IsNullOrWhiteSpace(line))
                    {
                        continue;
                    }

                    Log log = Log.Parse(line);

                    LogLoadedCancelEventArgs lac = new LogLoadedCancelEventArgs(log);
                    this.OnLogLoaded(lac);
                    this.cancel = lac.Cancel;

                    if (cancel)
                    {
                        return;
                    }
                }
            }

            this.FinalizeLoading();
        }