Interface IDocumentSourceInfo
Describes the source of an IDocument, usable for debugging, diagnostic or informational purposes.
Inherited Members
Namespace: ZptSharp.Rendering
Assembly: ZptSharp.Abstractions.dll
Syntax
public interface IDocumentSourceInfo : IEquatable<IDocumentSourceInfo>
Remarks
In most common scenarios ZPT source documents are files on a file system. This is not a requirement for ZptSharp though. Source documents might come from anywhere, including (but not limited to):
- A database
- Embedded resources
- A remote API
Because the document provider API: IReadsAndWritesDocument deals only with streams rather than files, the source of the document does not matter there. Implementations of this interface are then used to describe the source of the document in an extensible manner. If an application introduces a new 'kind' of source (for example a primary key from a database table) then that application may create a new implementation of this interface in order to describe that new source.
ZptSharp comes with three implementations already created:
- FileSourceInfo represents the most common scenario where a document originated as a file on a file system.
- OtherSourceInfo represents an abstract concept of a source which may be described by a string, but which is specifically not a file.
- UnknownSourceInfo is used in the fall-back scenario where source information is not provided.
Properties
| Improve this Doc View SourceName
Gets the name of the source.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
System.String | The name of the document source. |
Remarks
Every document source must have a name/string representation in some manner. This name should reasonably identify the source such that it would be enough for a developer to identify that source.
Examples
In the case of a source file, for example, this name might return the file path. In the case of a document from a database, this name might be a unique identifier for a row.