forked from danbarua/Npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNpgsqlProviderObjectFactory.cs
More file actions
40 lines (34 loc) · 1.3 KB
/
NpgsqlProviderObjectFactory.cs
File metadata and controls
40 lines (34 loc) · 1.3 KB
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
/********************************************************
* 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 Npgsql.Designer
{
using System;
using Microsoft.VisualStudio.Data.AdoDotNet;
using Microsoft.VisualStudio.Data;
using System.Runtime.InteropServices;
using Microsoft.Data.ConnectionUI;
/// <summary>
/// For a package-based provider, this factory creates instances of the main objects we support
/// </summary>
[Guid("DCBE6C8D-0E57-4099-A183-98FF74C64D9D")]
internal sealed class NpgsqlProviderObjectFactory : AdoDotNetProviderObjectFactory
{
public NpgsqlProviderObjectFactory()
{
}
public override object CreateObject(Type objType)
{
if (objType == typeof(DataConnectionSupport))
return new NpgsqlDataConnectionSupport();
if (objType == typeof(IDataConnectionProperties) || objType == typeof(DataConnectionProperties))
return new NpgsqlConnectionProperties();
if (objType == typeof(IDataConnectionUIControl) || objType == typeof(DataConnectionUIControl))
return new NpgsqlConnectionUIControl();
return base.CreateObject(objType);
}
}
}