/********************************************************
* ADO.NET 2.0 Data Provider for SQLite Version 3.X
* Written by Robert Simpson (robert@blackcastlesoft.com)
*
* Released to the public domain, use at your own risk!
********************************************************/
namespace Mono.Data.Sqlite
{
using System;
using System.Runtime.InteropServices;
///
/// A simple custom attribute to enable us to easily find user-defined functions in
/// the loaded assemblies and initialize them in SQLite as connections are made.
///
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
public sealed class SqliteFunctionAttribute : Attribute
{
private string _name;
private int _arguments;
private FunctionType _functionType;
internal Type _instanceType;
///
/// Default constructor, initializes the internal variables for the function.
///
public SqliteFunctionAttribute()
{
Name = "";
Arguments = -1;
FuncType = FunctionType.Scalar;
}
///
/// The function's name as it will be used in SQLite command text.
///
public string Name
{
get { return _name; }
set { _name = value; }
}
///
/// The number of arguments this function expects. -1 if the number of arguments is variable.
///
public int Arguments
{
get { return _arguments; }
set { _arguments = value; }
}
///
/// The type of function this implementation will be.
///
public FunctionType FuncType
{
get { return _functionType; }
set { _functionType = value; }
}
}
}