DiagnosticsBag Class
A container for DiagnosticMessage
public class DiagnosticsBag : IEnumerable<DiagnosticMessage>, IEnumerableConstructors
| Name | Description |
|---|---|
| DiagnosticsBag() | Creates a new instance of a DiagnosticsBag |
| DiagnosticsBag(IEnumerable<DiagnosticMessage>) | Creates a new instance of a DiagnosticsBag. |
DiagnosticsBag overloads
DiagnosticsBag()
DiagnosticsBag.csCreates a new instance of a DiagnosticsBag
public DiagnosticsBag()DiagnosticsBag(IEnumerable<DiagnosticMessage>)
DiagnosticsBag.csCreates a new instance of a DiagnosticsBag.
public DiagnosticsBag(IEnumerable<DiagnosticMessage> messages)Parameters
messagesIEnumerable<DiagnosticMessage>- An existing list of messages.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of messages. |
| HasErrors | Gets a boolean indicating if this bag contains any error messages. |
Count
DiagnosticsBag.csHasErrors
DiagnosticsBag.csIndexers
| Name | Description |
|---|---|
| this[int] | Gets the message at the specified index. |
this[int]
DiagnosticsBag.csGets the message at the specified index.
public DiagnosticMessage this[int index] { get; }Methods
| Name | Description |
|---|---|
| Add(DiagnosticMessage) | Adds the specified message to this bag. |
| AddRange(IEnumerable<DiagnosticMessage>) | Adds the specified list of messages to this bag. |
| Clear() | Clear this bag including the error state. |
| Error(SourceSpan, string) | Adds an error message |
| GetEnumerator() | Gets the enumerator of DiagnosticMessage |
| System.Collections.Generic.IEnumerable<Meziantou.Framework.Toml.Syntax.DiagnosticMessage>.GetEnumerator() | |
| System.Collections.IEnumerable.GetEnumerator() | |
| ToString() | Returns a string that represents the current object. |
| Warning(SourceSpan, string) | Adds a warning message |
Add(DiagnosticMessage)
DiagnosticsBag.csAdds the specified message to this bag.
public void Add(DiagnosticMessage message)Parameters
messageDiagnosticMessage- The message to add
AddRange(IEnumerable<DiagnosticMessage>)
DiagnosticsBag.csAdds the specified list of messages to this bag.
public void AddRange(IEnumerable<DiagnosticMessage> messages)Parameters
messagesIEnumerable<DiagnosticMessage>- A list of messages.
Clear()
DiagnosticsBag.csClear this bag including the error state.
public void Clear()Error(SourceSpan, string)
DiagnosticsBag.csAdds an error message
public void Error(SourceSpan span, string text)Parameters
spanSourceSpan- The source span
textstring- The error message
GetEnumerator()
DiagnosticsBag.csGets the enumerator of DiagnosticMessage
public List<DiagnosticMessage>.Enumerator GetEnumerator()System.Collections.Generic.IEnumerable<Meziantou.Framework.Toml.Syntax.DiagnosticMessage>.GetEnumerator()
DiagnosticsBag.csIEnumerator<DiagnosticMessage> IEnumerable<DiagnosticMessage>.GetEnumerator()No documentation is available.
System.Collections.IEnumerable.GetEnumerator()
DiagnosticsBag.csToString()
DiagnosticsBag.csWarning(SourceSpan, string)
DiagnosticsBag.csAdds a warning message
public void Warning(SourceSpan span, string text)Parameters
spanSourceSpan- The source span
textstring- The warning message