C# Class Microsoft.Cci.ErrorMessage

Inheritance: ISourceErrorMessage
显示文件 Open project: visualmutator/visualmutator Class Usage Examples

Private Properties

Property Type Description
ObjectInvariant void

Public Methods

Method Description
MakeShallowCopy ( ISourceDocument targetDocument ) : ISourceErrorMessage

Makes a copy of this error message, changing only Location and SourceLocation to come from the given source document. Returns the same instance if the given source document is the same as this.SourceLocation.SourceDocument.

Protected Methods

Method Description
ErrorMessage ( ISourceLocation sourceLocation, long errorCode, string messageKey ) : System

Initializes an object providing error information relating to a portion of a source document.

ErrorMessage ( ISourceLocation sourceLocation, long errorCode, string messageKey, IEnumerable relatedLocations ) : System

Initializes an object providing error information relating to a portion of a source document.

GetMessage ( System rm ) : string

Obtains a localized message from the given resource manager and formats it using the message arguments associated with this error message. If no localized message corresponds to the message key of this message, the invariant culture is used. If no message corresponding to this error can be found then the message key itself is returned.

MessageArguments ( ) : string[]

Zero or more strings that are to be subsituted for "{i}" sequences in the message string return by GetMessage.

Private Methods

Method Description
ObjectInvariant ( ) : void

Method Details

ErrorMessage() protected method

Initializes an object providing error information relating to a portion of a source document.
protected ErrorMessage ( ISourceLocation sourceLocation, long errorCode, string messageKey ) : System
sourceLocation ISourceLocation The location of the error in the source document.
errorCode long A code that corresponds to this error. This code is the same for all cultures.
messageKey string A string that is used as the key when looking for the localized error message using a resource manager.
return System

ErrorMessage() protected method

Initializes an object providing error information relating to a portion of a source document.
protected ErrorMessage ( ISourceLocation sourceLocation, long errorCode, string messageKey, IEnumerable relatedLocations ) : System
sourceLocation ISourceLocation The location of the error in the source document.
errorCode long A code that corresponds to this error. This code is the same for all cultures.
messageKey string A string that is used as the key when looking for the localized error message using a resource manager.
relatedLocations IEnumerable Zero ore more locations that are related to this error.
return System

GetMessage() protected method

Obtains a localized message from the given resource manager and formats it using the message arguments associated with this error message. If no localized message corresponds to the message key of this message, the invariant culture is used. If no message corresponding to this error can be found then the message key itself is returned.
protected GetMessage ( System rm ) : string
rm System A resource manager corresponding to the current locale.
return string

MakeShallowCopy() public abstract method

Makes a copy of this error message, changing only Location and SourceLocation to come from the given source document. Returns the same instance if the given source document is the same as this.SourceLocation.SourceDocument.
public abstract MakeShallowCopy ( ISourceDocument targetDocument ) : ISourceErrorMessage
targetDocument ISourceDocument The document to which the resulting error message must refer.
return ISourceErrorMessage

MessageArguments() protected method

Zero or more strings that are to be subsituted for "{i}" sequences in the message string return by GetMessage.
protected MessageArguments ( ) : string[]
return string[]