DataProviderBase
Represents a wrapper of ITextBasedDocumentFormatProvider allowing the latter to be used in data binding scenarios.
Definition
Namespace:Telerik.WinForms.Documents.FormatProviders
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class DataProviderBase : FrameworkElement, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, ISupportDrop
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementUIElementFrameworkElementDataProviderBase...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the DataProviderBase class.
public DataProviderBase(ITextBasedDocumentFormatProvider formatProvider, FrameworkElement propertyOwner, RadProperty stringProperty)
The format provider.
propertyOwnerFrameworkElementThe property owner.
stringPropertyRadPropertyThe string property.
Initializes a new instance of the DataProviderBase class.
public DataProviderBase(ITextBasedDocumentFormatProvider formatProvider, RadProperty stringProperty)
The format provider.
stringPropertyRadPropertyThe string property.
public DataProviderBase(ITextBasedDocumentFormatProvider formatProvider, RadRichTextBox propertyOwner, RadProperty stringProperty)
Fields
The format provider property.
public static readonly RadProperty FormatProviderProperty
The rich text box property.
public static readonly RadProperty RichTextBoxProperty
The update source trigger property.
public static readonly RadProperty UpdateSourceTriggerProperty
Properties
Gets or sets the ITextBasedDocumentFormatProvider that is used when converting the document.
public ITextBasedDocumentFormatProvider FormatProvider { get; set; }
Gets or sets the RadRichTextBox this DataProvider is attached to.
public RadRichTextBox RichTextBox { get; set; }
Gets or sets the string representing the document.
protected string String { get; set; }
The string.
Gets or sets the update source trigger.
public DataProviderUpdateSourceTrigger UpdateSourceTrigger { get; set; }
The update source trigger.
Methods
Binds the specified RadRichTextBox.
protected virtual void Bind(RadRichTextBox radRichTextBox)
The RadRichTextBox.
Creates a custom string property.
protected static RadProperty CreateStringProperty(string name)
The name.
Returns:Called after changing the attached data provider.
public static void OnAttachedDataProviderPropertyChanged(RadObject dependencyObject, RadPropertyChangedEventArgs e)
The dependency object.
eRadPropertyChangedEventArgsThe RadPropertyChangedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnImportException(DataProviderImportExceptionEventArgs args)
The DataProviderImportExceptionEventArgs instance containing the event data.
Called when the data provider creates a new document.
protected virtual void OnSetupDocument(RadDocument document)
The document.
Called when the string associated to the provider is changed.
protected virtual void OnStringChanged()
Sets the value respecting one way bindings.
A callback invoked when the associated string is changed.
protected static void StringPropertyChangedCallback(RadObject sender, RadPropertyChangedEventArgs e)
The sender.
eRadPropertyChangedEventArgsThe RadPropertyChangedEventArgs instance containing the event data.
Unbinds the specified RadRichTextBox instance.
protected virtual void Unbind(RadRichTextBox radRichTextBox)
The RadRichTextBox.
Updates the attached data provider.
public static void UpdateAttachedDataProvider(RadObject dependencyObject, Func<RadRichTextBox, DataProviderBase> formatProviderFactory, Func<RadObject, DataProviderBase> getAttachedDataProvider, Action<RadObject, DataProviderBase> setAttachedDataProvider, RadProperty attachedDataProviderProperty, object newValue)
The dependency object.
formatProviderFactoryFunc<RadRichTextBox, DataProviderBase>The format provider factory.
getAttachedDataProviderFunc<RadObject, DataProviderBase>A function that can get the attached to RadRichTextBox data provider.
setAttachedDataProviderAction<RadObject, DataProviderBase>A function that can set the attached to RadRichTextBox data provider.
attachedDataProviderPropertyRadPropertyThe attached data provider property.
newValueobjectThe new value.
Updates the document inside the control.
public virtual void UpdateDocument()
Updates the string representing the document.
public virtual void UpdateString()
Events
Occurs when the import causes an exception.
public event EventHandler<DataProviderImportExceptionEventArgs> ImportException
Occurs when the data provider creates a new document.
public event EventHandler<SetupDocumentEventArgs> SetupDocument
Occurs after the string associated to the provider changes.
protected event EventHandler StringChanged