forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNpgsqlProviderObjectFactory.cs
More file actions
25 lines (24 loc) · 1.2 KB
/
NpgsqlProviderObjectFactory.cs
File metadata and controls
25 lines (24 loc) · 1.2 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
using Microsoft.VisualStudio.Data.Framework;
using Microsoft.VisualStudio.Data.Framework.AdoDotNet;
using Microsoft.VisualStudio.Data.Services.SupportEntities;
using System;
using System.Runtime.InteropServices;
namespace Npgsql.VisualStudio.Provider
{
[Guid(GuidList.guidNpgsqlDdexProviderObjectFactoryString)]
class NpgsqlProviderObjectFactory : DataProviderObjectFactory
{
public override object CreateObject(Type objType)
{
if (objType == typeof(IVsDataConnectionProperties) || objType == typeof(IVsDataConnectionUIProperties))
return new AdoDotNetConnectionProperties();
else if (objType == typeof(IVsDataConnectionSupport))
return new AdoDotNetConnectionSupport();
else if (objType == typeof(IVsDataObjectSupport))
return new DataObjectSupport(this.GetType().Namespace + ".NpgsqlDataObjectSupport", System.Reflection.Assembly.GetExecutingAssembly());
else if (objType == typeof(IVsDataViewSupport))
return new DataViewSupport(this.GetType().Namespace + ".NpgsqlDataViewSupport", System.Reflection.Assembly.GetExecutingAssembly());
return null;
}
}
}