Enhanced C#
Language of your choice: library documentation
|
This interface allows an object to declare its "location". More...
This interface allows an object to declare its "location".
Objects designed to be used as a context parameter in IMessageSink<T> can implement this interface so that the string form of the message shows the location of a piece of data instead of the data itself. For example, Loyc.Syntax.LNode implements this interface so that when a compiler error refers to a source code construct, the context of the LogMessage can refer to the code itself while the printed form of the the error message shows the location of the code instead.
Given a context object that may or may not implement this interface, it's handy to use MessageSink.ContextToString to convert the "context" of a message into a string, or MessageSink.LocationOf(object) to unwrap objects that implement IHasLocation.
Properties | |
object | Location [get] |