示例#1
0
 /// <summary>
 /// Actually writes the diagnostics to the target file.
 /// </summary>
 public virtual void Push()
 {
     if (_bag.Count > 0)
     {
         Generator.LogDiagnostics(Node !, HintName !, _bag.GetDiagnostics());
         Clear();
     }
 }
        internal IEnumerable <Diagnostic> Commit(bool reportThroughContainingContext)
        {
            try
            {
                if (reportThroughContainingContext && held != null)
                {
                    foreach (var d in held.GetDiagnostics())
                    {
                        base.ReportDiagnostic(d);
                    }
                }

                return((held == null) ? SpecializedCollections.EmptyEnumerable <Diagnostic>() : held.GetDiagnostics());
            }
            finally
            {
                held = null;
            }
        }