/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v4.1.13
src/VSIX/NpgsqlProviderObjectFactory.cs
36 строк
2 KB
Shay Rojansky
Convert codebase to use C# 8 nullability
05 май 2019, 21:55
05 май 2019, 21:55
f2dd3f7
Код
Авторство
О чём код?
using Microsoft.VisualStudio.Data.Framework; using Microsoft.VisualStudio.Data.Framework.AdoDotNet; using Microsoft.VisualStudio.Data.Services.SupportEntities; using System; using System.Reflection; using System.Runtime.InteropServices; #nullable disable namespace Npgsql.VSIX { [Guid(Guid)] class NpgsqlProviderObjectFactory : DataProviderObjectFactory { internal const string Guid = "555cd66B-3393-4bab-84d9-3f2caa639699"; public override object CreateObject(Type objType) { if (objType == typeof(IVsDataConnectionSupport)) return new AdoDotNetConnectionSupport(); if (objType == typeof(IVsDataConnectionProperties) || objType == typeof(IVsDataConnectionUIProperties)) return new NpgsqlConnectionProperties(); if (objType == typeof(IVsDataConnectionUIControl)) return new NpgsqlConnectionUIControl(); if (objType == typeof(IVsDataSourceInformation)) return new NpgsqlSourceInformation(); if (objType == typeof(IVsDataObjectSupport)) return new DataObjectSupport($"{GetType().Namespace}.NpgsqlDataObjectSupport", Assembly.GetExecutingAssembly()); if (objType == typeof(IVsDataViewSupport)) return new DataViewSupport($"{GetType().Namespace}.NpgsqlDataViewSupport", Assembly.GetExecutingAssembly()); if (objType == typeof(IVsDataConnectionEquivalencyComparer)) return new NpgsqlConnectionEquivalencyComparer(); return null; } } }