[]
        
(Showing Draft Content)

C1.WPF.Document.C1DocumentSource

C1DocumentSource Class

Abstract base class for types that can create and manage a C1Document object from some source.

Derived classes provide implementation for specific sources such as SSRS reports etc.

The common base (C1DocumentSource) allows to work with various document and reports types (e.g. previewing or printing them) in a uniform manner.

Implements
Namespace: C1.WPF.Document
Assembly: C1.WPF.Document.4.6.2.dll
Syntax
public abstract class C1DocumentSource : Component, IComponent, IDisposable

Constructors

Name Description
C1DocumentSource()

Initializes a new instance of the C1DocumentSource class.

Properties

Name Description
AsyncMethodsUseAwaitPattern

Gets or sets a value indicating whether calls to async methods of the current document source expect the async/await pattern to be used by the calling code. If this property is true, then the *Completed events (such as GenerateCompleted, GenerateCompleted and others) do not fire.

BusyState

Gets the current busy state of the current C1DocumentSource.

Credential

Gets or sets the NetworkCredential object specifying the credentials which will be used to access data for document generation.

DefaultPrintOptions

Gets the C1PrintOptions object defining default print options used by printing methods of C1DocumentSource.

Dirty

Gets a value indicating whether the current content is dirty and does not correspond to the current values of C1.WPF.Document.C1DocumentSource.Paginated etc.

Document

Gets a C1Document object produced by the current document source.

DocumentName

Gets a name of the document.

Features

Gets the C1DocumentSourceFeatures object specifying the set of features supported by this C1DocumentSource.

IsBusy

Gets the value indicating whether the current C1DocumentSource busy.

IsDisposed

Gets a value indicating whether this C1DocumentSource is disposed and can not be longer used.

IsUserInteractive

Gets a value indicating whether the current document source is running in a user-interactive environment. This property returns false when running in a service, web app and so on.

Log

Gets the LogEntryList containing the list of events which occured during the last operation (generating, exporting etc).

PageCount

Gets the number of already generated pages.

PageSettings

Gets or sets the C1PageSettings object specifying the page settings to use when generating a paginated document (see C1.WPF.Document.C1DocumentSource.Paginated).

Parameters

Gets a collection of parameters used to generate content.

SupportedExportProviders

Gets an array of exporters supported by the current document source object.

Methods

Name Description
AddToLog(LogEntrySeverity, string)

Adds log entry to the Log list.

AddToLog(LogEntrySeverity, string, params object[])

Adds log entry to the Log list.

AddToLog(Exception)

Adds log entry to the Log list.

CancelAsync()

Cancels currently executed async action and waits until action will be actually cancelled.

ClearContent()

Clear generated content and sets Dirty to true.

CreateParametersCollection()

Creates the ParameterCollection object.

Dispose(bool)

Releases the unmanaged resources used by the Component and optionally releases the managed resources.

ExecuteAction(C1DocumentAction)

Executes an action specified by the C1DocumentAction object.

ExecuteActionAsync(C1DocumentAction)

Non-blocking (asynchronous) version of the ExecuteAction(C1DocumentAction) method.

ExecuteActionAsyncEx(C1DocumentAction)

Non-blocking (asynchronous) version of the ExecuteAction(C1DocumentAction) method.

Export(ExportFilter)

Exports the document into a stream in an external format using the specified export filter.

ExportAsync(ExportFilter)

Non-blocking (asynchronous) version of the Export(ExportFilter) method.

ExportAsyncEx(ExportFilter)

Non-blocking (asynchronous) version of the Export(ExportFilter) method.

FirePageCountChanged()

For internal use.

Generate()

Generates the document.

GenerateAsync()

Non-blocking (asynchronous) version of the Generate() method.

GenerateAsyncEx()

Non-blocking (asynchronous) version of the Generate() method.

GetDocumentRange(C1DocumentTextPosition, C1DocumentTextPosition, IC1TextMeasurementContext)

Creates the C1.WPF.Document.C1DocumentRange object on the base of two text positions specified by C1.WPF.Document.C1DocumentTextPosition objects.

GetPageDocumentRange(C1Page, IC1TextMeasurementContext)

Creates a C1.WPF.Document.C1DocumentRange object that includes the specified page. This method can return null if the page contains no text.

GetWholeDocumentRange(IC1TextMeasurementContext)

Creates a C1.WPF.Document.C1DocumentRange object that includes the whole document. This method can return null if the document contains no text.

GetWordDocumentRange(C1DocumentTextPosition, IC1TextMeasurementContext)

Creates a C1.WPF.Document.C1DocumentRange object that defines a word containing a specified position in the document.

Init()

Called from constructor, initializes an object.

IsGenerateAllowed()

Returns a value indicating whether the Generate() method can be called at the moment.

OnBusyStateChanged()

For internal use.

OnDirtyChanged()

For internal use.

OnExportCompleted(ExportFilter, Exception)

For internal use.

OnGenerateCompleted(Exception)

For internal use.

OnGetLinkTargetPositionCompleted(C1LinkTargetBase, C1BookmarkPosition, Exception)

For internal use.

OnGetPageCompleted(int, C1Page, Exception)

For internal use.

OnLongOperation(double, bool)

For internal use.

OnPageCountChanged()

For internal use.

OnPagesClear()

For internal use.

OnPagesLoaded(int, int)

For internal use.

OnSecurityError(string, int)

For internal use.

OnValidateParametersCompleted(List<ParameterValidationError>, Exception)

For internal use.

Print()

Prints the generated report.

Print(C1PrintOptions)

Prints the generated document.

ValidateParameters()

Validates the current parameter values, refreshes their valid values' lists if the values are valid.

ValidateParametersAsync()

Non-blocking (asynchronous) version of the ValidateParameters() method.

ValidateParametersAsyncEx()

Non-blocking (asynchronous) version of the ValidateParameters() method.

Events

Name Description
BusyStateChanged

Occurs when the BusyState property value changes.

DirtyChanged

Occurs when the Dirty property value changes.

ExportCompleted

Occurs when the ExportAsync(ExportFilter) method has completed.

GenerateCompleted

Occurs when the GenerateAsync() method has completed.

LongOperation

Occurs periodically during various document operations. Allows to provide progress indication and the ability to cancel some long operations such as document generation.

PageCountChanged

Occurs when the PageCount property value changes.

SecurityError

Occurs when a securiy exception occurs during a document source operation. This event allows to correct security-related properties like NetworkCredential and retry a failed operation with new credentials.

ValidateParametersCompleted

Occurs when the ValidateParametersAsync() method has completed.