forked from jstedfast/MimeKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLiteFunctionAttribute.cs
62 lines (56 loc) · 1.74 KB
/
SQLiteFunctionAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/********************************************************
* ADO.NET 2.0 Data Provider for SQLite Version 3.X
* Written by Robert Simpson ([email protected])
*
* Released to the public domain, use at your own risk!
********************************************************/
namespace Mono.Data.Sqlite
{
using System;
using System.Runtime.InteropServices;
/// <summary>
/// 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.
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
public sealed class SqliteFunctionAttribute : Attribute
{
private string _name;
private int _arguments;
private FunctionType _functionType;
internal Type _instanceType;
/// <summary>
/// Default constructor, initializes the internal variables for the function.
/// </summary>
public SqliteFunctionAttribute()
{
Name = "";
Arguments = -1;
FuncType = FunctionType.Scalar;
}
/// <summary>
/// The function's name as it will be used in SQLite command text.
/// </summary>
public string Name
{
get { return _name; }
set { _name = value; }
}
/// <summary>
/// The number of arguments this function expects. -1 if the number of arguments is variable.
/// </summary>
public int Arguments
{
get { return _arguments; }
set { _arguments = value; }
}
/// <summary>
/// The type of function this implementation will be.
/// </summary>
public FunctionType FuncType
{
get { return _functionType; }
set { _functionType = value; }
}
}
}