Class DataSource
This class incapsulates source data of the document.
Inheritance
Inherited Members
Namespace: Syncfusion.HTMLUI.Base.Utility
Assembly: Syncfusion.HTMLUI.Base.dll
Syntax
public class DataSource : IResourceProvider, IDisposable
Constructors
DataSource(Stream)
Creates a new object with the specified source stream.
Declaration
public DataSource(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Source stream of the data. |
DataSource(String)
Creates a new object with the specified filename.
Declaration
public DataSource(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName | Name of the file. |
DataSource(Uri)
Creates a new object with the specified uri.
Declaration
public DataSource(Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | uri | Uri of the resource. |
Properties
DataProvider
Returns the data provider object.
Declaration
public IResourceProvider DataProvider { get; }
Property Value
| Type |
|---|
| IResourceProvider |
DefaultDataProvider
Returns the default data provider.
Declaration
public IResourceProvider DefaultDataProvider { get; }
Property Value
| Type |
|---|
| IResourceProvider |
Remarks
It may be used by hyperlinks for path resolving, web forms, etc.
FileName
Returns the path to the document.
Declaration
public string FileName { get; }
Property Value
| Type |
|---|
| System.String |
Format
Returns the format of the document's data.
Declaration
public DataFormat Format { get; }
Property Value
| Type |
|---|
| DataFormat |
IsFileName
Indicates whether input HTML document is loaded from file.
Declaration
public bool IsFileName { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsStream
Indicates whether input HTML document is loaded from stream.
Declaration
public bool IsStream { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsUri
Indicates whether input HTML document is loaded by Uri.
Declaration
public bool IsUri { get; }
Property Value
| Type |
|---|
| System.Boolean |
RootDirectory
Gets or sets the current directory for this document.
Declaration
public string RootDirectory { get; set; }
Property Value
| Type |
|---|
| System.String |
Stream
Returns the stream containing document's data.
Declaration
public Stream Stream { get; }
Property Value
| Type |
|---|
| System.IO.Stream |
Uri
Returns the Uri to the document.
Declaration
public Uri Uri { get; }
Property Value
| Type |
|---|
| System.Uri |
Methods
Dispose()
Clears all resources used by this class.
Declaration
public void Dispose()
GetDocumentBody()
Searches for a body of the document and returns data of it.
Declaration
public TokenStream GetDocumentBody()
Returns
| Type | Description |
|---|---|
| TokenStream | Data within document's body if found; Null otherwise. |
GetDocumentContent()
Returns the original content of the document if it's possible to retrieve.
Declaration
public string GetDocumentContent()
Returns
| Type | Description |
|---|---|
| System.String | Original content of the document if it's possible to retrieve. |
GetInputStream(out Boolean)
Checks input properties of InputHTML class and creates TokenStream which is needed for correct conversion.
Declaration
public TokenStream GetInputStream(out bool bClose)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bClose | Indicates whether we must close stream or not. |
Returns
| Type | Description |
|---|---|
| TokenStream | Stream which provides access to HTML document. |
GetResource(String)
Overloaded. Searches for resource by it's location inside the document.
Declaration
public Stream GetResource(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | Path to the resource. |
Returns
| Type | Description |
|---|---|
| System.IO.Stream | Data of resource if found; Null otherwise. |
GetResource(String, ResourceType)
Searches for resource by it's location inside the document.
Declaration
public Stream GetResource(string fullPath, ResourceType type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fullPath | Full path to the resource. |
| ResourceType | type | Type of resource. |
Returns
| Type | Description |
|---|---|
| System.IO.Stream | Data of resource if found; Null otherwise. |
ResourceExists(String, out String, out ResourceType)
Indicates whether resource with specified path exists. Checks as local file as remote resource.
Declaration
public bool ResourceExists(string path, out string fullPath, out ResourceType type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | Path for searching. |
| System.String | fullPath | Full path to resource. |
| ResourceType | type | Type of resource. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if resource is found; False otherwise. |