Click or drag to resize
DataItemProvider Class
Represents a provider of data items. This is the base class that all data item providers must inherit from.
Inheritance Hierarchy

Namespace: Dynamicweb.Deployment
Assembly: Dynamicweb.Deployment (in Dynamicweb.Deployment.dll) Version: 2.0.1
Syntax
public abstract class DataItemProvider : ConfigurableAddIn

The DataItemProvider type exposes the following members.

Constructors
  NameDescription
Protected methodDataItemProvider
Initializes a new instance of the DataItemProvider class
Top
Properties
  NameDescription
Public propertyDataItemType
Gets the type of the data item.
Top
Methods
  NameDescription
Public methodStatic memberCreateInstance
Creates an instance of a data item provider for a specific data item type.
Public methodCreateReader
Creates the data item reader.
Public methodCreateWriter
Creates the data item writer.
Public methodStatic memberGetDataProviderTypes
Gets the data provider types.
Public methodGetIdSuitableString
Gets the id suitable string.
(Inherited from ConfigurableAddIn.)
Public methodGetParametersToDictionary
Gets the parameters as a dictionary.
Public methodGetParametersToXml
Gets the parameters to XML.
(Inherited from ConfigurableAddIn.)
Public methodGetParametersToXml(Boolean)
Gets the parameters to XML.
(Inherited from ConfigurableAddIn.)
Public methodLoadParametersFromDictionary
Loads the parameters from dictionary.
Public methodLoadParametersFromXml
Loads the parameters from XML.
(Inherited from ConfigurableAddIn.)
Public methodRenderAdditionalContent
Renders the content of the additional.
(Inherited from ConfigurableAddIn.)
Public methodSetValue
Sets the value.
(Inherited from ConfigurableAddIn.)
Public methodUpdateFromPost
Updates from post back.
Remarks
Get the parameter from Context.Current.Request.Form
Form information. Null is allowed.
(Inherited from ConfigurableAddIn.)
Top
Examples
Implementing a data item provider
using Dynamicweb.Extensibility.AddIns;

namespace Dynamicweb.Deployment.Examples
{
    /// <summary>
    /// This is an example of how to implement a custom data item provider. 
    /// Data item providers inherit from <see cref="ConfigurableAddIn"/> which means that you can add additional parameters for use when reading or writing data items.
    /// </summary>
    public class CustomDataItemProvider : DataItemProvider
    {
        /// <summary>
        /// Gets or sets my property.
        /// </summary>
        [AddInParameter("MyProperty")]
        public string MyProperty { get; set; }

        public override DataItemReader CreateReader()
        {
            return new CustomDataItemReader(this);
        }

        public override DataItemWriter CreateWriter()
        {
            return new CustomDataItemWriter(this);
        }
    }
}
See Also