Interface INativeTextLocationMessageReporter
Message reporter specialization that allows line and offset numbers to be associated with messages to relate to locations in plain text files.
Namespace: SdlSdl.FileTypeSupportFrameworkNativeApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public interface INativeTextLocationMessageReporter : IBasicMessageReporter
Remarks
This interface is used by any components that want to report issues relating to the native file format, where the file format is interpreted as plain text and locations are referenced by line and offset numbers. The framework will attempt to map the locations in the bilingual content for those cases in which users should be able to navigate to the corresponding document location by clicking a message.
Native file writers must use this mechanism to associate locations with error messages, as they have no output content stream in which to insert location markers. File sniffers and pre- and post-processors are other components that may want to report issues with associated locations, but do not have access to the native content stream.
Methods
ReportMessage(object, string, ErrorLevel, string, NativeTextLocation, NativeTextLocation)
Used by file writers etc. in order to report a non-critical issue with an associated content range or location expressed in line and character offset numbers in the original native file format.
Declaration
void ReportMessage(object source, string origin, ErrorLevel level, string message, NativeTextLocation fromLocation, NativeTextLocation uptoLocation)
Parameters
Type | Name | Description |
---|---|---|
object | source | |
string | origin | The description of the action/component from which this message originated. |
ErrorLevel | level | |
string | message | |
NativeTextLocation | fromLocation | Start location in the native text file |
NativeTextLocation | uptoLocation | (Optional) end location in the native text file. You can pass |
Remarks
When converting the locations to bilingual or native content the line and offset numbers will be interpreted by the framework as referring to the textual content of the content that is processed through the native API. The framework will count the number of characters and line breaks that appear inside text and tags in an attempt to reference the corresponding location in the native content stream or in the bilingual content model (as needed). That means that if the tags and text in the native content fully correspond to the original file format, the locations will map well. If this is not the case, it is recommended that you use the IBasicMessageReporter interface, and refer to locations in an explanatory manner instead (e.g. through a message box).