Click or drag to resize

UserDataProvider Class

Base class for creating a custom DataProvider that can be implemented in Easymap.
Inheritance Hierarchy

Namespace:  Easymap.AddIn.Data.Provider
Assembly:  Easymap.AddIn (in Easymap.AddIn.dll) Version: 11.2.0.0
Syntax
public abstract class UserDataProvider : DataProvider

The UserDataProvider type exposes the following members.

Properties
  NameDescription
Public propertyAllowLinking
Gets a value indicating whether linked tables are allowed to import.
Public propertyCanRetrieveData
Gets a value indicating whether data can be retrieved from the specified datasource.
(Overrides DataProviderCanRetrieveData.)
Public propertyCanUse
Gets a value indicating whether specified UserDataProvider can be used.
(Overrides DataProviderCanUse.)
Public propertyCultureInfo
Gets or sets the CultureInfo if needed.
Public propertyIcon
Gets the icon of the specified UserDataProvider.
(Overrides DataProviderIcon.)
Public propertyProperties
Gets or sets (internal) Key-Value pairs which will be stored in the associated Easymap workbook.
Public propertyPropertyPages
Gets an array of custom WizardPages.
Public propertySchemaTable
Gets the schema of a DataTable which will be imported.
Public propertySelectedTableName
Gets or sets the name of the current selected DataTable.
(Overrides DataProviderSelectedTableName.)
Public propertyTableTitle
Gets the name of the new table in Easymap.
(Overrides DataProviderTableTitle.)
Public propertyTitle
Gets the title of a UserDataProvider which will be shown in the import form.
(Overrides DataProviderTitle.)
Top
Methods
Examples
Sample class for a custom UserDataProvider that imports xml files.
[Easymap.AddIn.Data.Provider.UserDataProvider("XML-Data-Provider", "XML-Data-Provider for loading xml files in a Easymap table.")]
public class XMLDataProvider : Easymap.AddIn.Data.Provider.UserDataProvider
{
    private Easymap.AddIn.Common.Controls.WizardPage[] _CustomWizardPages = new Easymap.AddIn.Common.Controls.WizardPage[1];
    public override bool AllowLinking
    {
        get { return (false); }
    }
    public override bool CanRetrieveData
    {
        get { return (true); }
    }
    public override bool CanUse
    {
        get { return (true); }
    }
    public override System.Data.IDataReader CreatePreviewReader()
    {
        return (System.Data.IDataReader)DataTable.CreateDataReader());
    }
    public override System.Data.IDataReader CreateReader()
    {
        return ((System.Data.IDataReader)DataTable.CreateDataReader());
    }
    public override System.Globalization.CultureInfo CultureInfo
    {
        get
        {
            return (System.Globalization.CultureInfo.CurrentCulture);
        }
        set
        {
            //In this case not needed.
            throw new NotImplementedException();
        }
    }
    public override Document Document
    {
        get
        {
            return base.Document;
        }
    }
    public override System.Drawing.Icon Icon
    {
        get { return (Resources.xml); }
    }
    public override Easymap.AddIn.Common.Controls.WizardPage[] PropertyPages
    {
        get
        {
            //Initialize custom WizardPage
            PageSelectFile page1 = new PageSelectFile();
            _CustomWizardPages[0] = page1;
            return (_CustomWizardPages);
        }
    }
    public override Easymap.AddIn.Data.Column[] Schema
    {
        get
        {
            return base.Schema;
        }
    }
    public override string SelectedTableName
    {
        get
        {
            return (DataTable.TableName);
        }
        set
        {
            //In this case not needed.
            throw new NotImplementedException();
        }
    }
    public override string Title
    {
        get { return ("XML-Data-Provider"); }
    }
    public override string TableTitle
    {
        get { return (DataTable.TableName); }
    }
    public override System.Data.DataTable SchemaTable
    {
        get { return (DataTable); }
    }
    public override void Refresh()
    {
        //In this case not needed.
        throw new NotImplementedException();
    }
}
See Also