Extension Components

BinaryDOM library provides a wide set of classes, automatic procedures and algorithms.
But, in some cases, it is not enough to describe some specific data formats.
Therefore, BinaryDOM library supports extension plug-ins implemented as .Net components. BinaryDOM library uses 2 kind of plug-ins:
  • Function plug-ins. It must be an assembly which implements IExternalFunction interface. It can be used in expressions in schema description and user-defined document queries.
  • Stream filter plug-ins. It must be an assembly which implements IStreamConverter interface. It can be for alternate views get and set as a transparent data encoder and decoder. It could implement, for example, compressor/decompressor or encryptor/decryptor.

Interface IStreamConverter


public interface IStreamConverter

Property/Method Parameters Description
property PluginName string Plug-in name.
property PluginDescription string Plug-in description.
Convert Stream from, Stream to, returns void Convert data, read from one Stream and write to another. Called when alternate view is created, i.e. performs decoding/decryption.
ConvertBack Stream from, Stream to, returns void Convert data, read from one Stream and write to another. Called when document data updated from alternate view, i.e. performs encoding/encryption.

Interface IExternalFunction


public interface IExternalFunction

Property/Method Parameters Description
property PluginName string Plug-in name.
property PluginDescription string Plug-in description.
Calculate BinNodeCollection parameters, returns BinNode performs some custom operation with provided parameters in BinNodeCollection. This collection could contain any number of BinNode arguments (including BinNodeCollection), depend on the purpose of the function. BinaryDOM library does not check parameters number and types.
This method could return BinNode of any type - from calculated immediate value wrapped by BinValueCalculated to collection of BinNode objects wrapped by BinNodeCollection.

See also: