diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs index 461b8980..34dc7502 100755 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs @@ -2381,6 +2381,22 @@ namespace Microsoft.SqlTools.ServiceLayer } } + public static string External_LabelPart + { + get + { + return Keys.GetString(Keys.External_LabelPart); + } + } + + public static string FileTable_LabelPart + { + get + { + return Keys.GetString(Keys.FileTable_LabelPart); + } + } + public static string DatabaseNotAccessible { get @@ -4639,6 +4655,12 @@ namespace Microsoft.SqlTools.ServiceLayer public const string SystemVersioned_LabelPart = "SystemVersioned_LabelPart"; + public const string External_LabelPart = "External_LabelPart"; + + + public const string FileTable_LabelPart = "FileTable_LabelPart"; + + public const string DatabaseNotAccessible = "DatabaseNotAccessible"; diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.de.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.de.resx index ec7f0db9..2ef7a4fe 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.de.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.de.resx @@ -87,11 +87,11 @@ Ein Skriptfehler ist aufgetreten. Ein Syntaxfehler ist aufgetreten der bei Analyse von {0} Ein schwerwiegender Fehler ist aufgetreten. - Die Ausführung wurde {0} Mal abgeschlossen... + {0}-mal ausgeführt... Sie haben die Abfrage abgebrochen. Fehler während der Batchausführung. Fehler während der Batchausführung, aber des Fehlers wurde ignoriert. - {0}-malige Batchausführung wurde gestartet. + Beginning execution loop Befehl {0} wird nicht unterstützt. Die Variable {0} konnte nicht gefunden werden. Fehler bei der SQL-Ausführung: {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.es.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.es.resx index c20052ae..eb2b138b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.es.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.es.resx @@ -87,11 +87,11 @@ Se ha producido un error de secuencias de comandos. Se encontró sintaxis incorrecta mientras se estaba analizando {0}. Se ha producido un error grave. - La ejecución completó {0} veces... + La ejecución se completó {0} veces... Se canceló la consulta. Se produjo un error mientras se ejecutaba el lote. Se produjo un error mientras se ejecutaba el lote, pero se ha omitido el error. - Iniciando bucle de ejecución de {0} veces... + Beginning execution loop No se admite el comando {0}. La variable {0} no se encontró. Error de ejecución de SQL: {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.fr.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.fr.resx index aa697a53..adc2950a 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.fr.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.fr.resx @@ -91,7 +91,7 @@ Vous avez annulé la requête. Une erreur s'est produite lors de l'exécution du lot. Une erreur s'est produite lors de l'exécution du lot, mais elle a été ignorée. - Démarrage de la boucle d'exécution pour {0} fois... + Beginning execution loop La commande {0} n'est pas prise en charge. Impossible de trouver la variable {0}. Erreur d’exécution de SQL : {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.it.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.it.resx index 8a7b4e9f..bbe62882 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.it.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.it.resx @@ -91,7 +91,7 @@ È stata annullata la query. Si è verificato un errore durante l'esecuzione del batch. Si è verificato un errore durante l'esecuzione del batch, ma l'errore è stato ignorato. - Avvio ciclo di esecuzione di {0} volte... + Beginning execution loop Il comando {0} non è supportato. Impossibile trovare la variabile {0}. Errore di esecuzione di SQL: {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ja.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ja.resx index 3c8a8e71..8464e2a4 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ja.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ja.resx @@ -87,11 +87,11 @@ スクリプト エラーが発生しました。 {0} の解析中に不正な構文が見つかりました。 致命的なエラーが発生しました。 - {0} 回の実行が完了... + 実行を {0} 回完了しました... クエリをキャンセルしました。 バッチの実行中にエラーが発生しました。 バッチの実行中にエラーが発生しましたが、エラーを無視しました。 - {0} 回の実行ループを開始しています. + Beginning execution loop コマンド {0} はサポートされていません。 変数 {0} が見つかりませんでした。 SQL の実行エラー: {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ko.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ko.resx index 71c1aad6..7d4e551f 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ko.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ko.resx @@ -87,11 +87,11 @@ 스크립팅 오류가 발생 했습니다. {0}에 잘못된 구문이 발견되었습니다. 치명적인 오류가 발생 했습니다. - 실행 완료 {0} 회 + {0}회 실행 완료... 쿼리를 취소 했습니다. 일괄 처리를 실행 하는 동안 오류가 발생 합니다. 일괄 처리를 실행 하는 동안 오류가 발생했으나 그 오류는 무시되었습니다. - {0} 번 루프 실행을 시작 하는 중... + Beginning execution loop {0} 명령은 지원되지 않습니다. {0} 변수를 찾을 수 없습니다. SQL 실행 오류: {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.pt-BR.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.pt-BR.resx index e61558da..92765727 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.pt-BR.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.pt-BR.resx @@ -91,7 +91,7 @@ Você cancelou a consulta. Ocorreu um erro enquanto o lote estava sendo executado. Ocorreu um erro enquanto o lote estava sendo executado, mas o erro foi ignorado. - Iniciando a execução do loop {0} vezes... + Beginning execution loop Comando {0} não é suportado. A variável {0} não pôde ser encontrada. Erro de execução de SQL: {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx index 44496a88..3e186b0c 100755 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx @@ -1378,6 +1378,14 @@ System-Versioned + + External + + + + File Table + + The database {0} is not accessible. diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ru.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ru.resx index 9618e387..9fe98a9d 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ru.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.ru.resx @@ -87,11 +87,11 @@ Произошла ошибка сценария. Обнаружен неправильный синтаксис при обработке {0}. Произошла неустранимая ошибка. - Выполнено {0} раз... + Выполнение завершено такое количество раз: {0}... Пользователь отменил запрос. При выполнении пакета произошла ошибка. В процессе выполнения пакета произошла ошибка, но она была проигнорирована. - Начало цикла выполнения {0} раз... + Beginning execution loop Команда {0} не поддерживается. Переменная {0} не найдена. Ошибка выполнения SQL: {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings index fb45be5e..71ca4655 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings @@ -684,6 +684,10 @@ History_LabelPart = History SystemVersioned_LabelPart = System-Versioned +External_LabelPart = External + +FileTable_LabelPart = File Table + DatabaseNotAccessible = The database {0} is not accessible. diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf index 7eb1fbb8..a0108e0c 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf @@ -2343,6 +2343,16 @@ Scripting as Execute is only supported for Stored Procedures + + External + External + + + + File Table + File Table + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hans.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hans.resx index 048fcfff..e1dd659e 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hans.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hans.resx @@ -38,7 +38,7 @@ ServerName 不能是 null 或是空白 使用 SqlLogin 身份验证时,{0} 不可是 null 或是空 查询已完成,无法取消 - 查询成功取消,无法处理查询。找不到的 URI 的所有者。 + 查询成功取消,无法处理查询。找不到 URI 的所有者。 查询已被用户取消 该批处理尚未完成 批量索引不能小于 0 或大于批量的总数 @@ -87,11 +87,11 @@ 出现脚本错误。 正在分析 {0} 时发现语法错误。 出现严重错误。 - 执行已完成 {0} 次... + 已执行完 {0} 次... 您已取消查询。 执行批次处理时发生错误。 执行批次处理时发生错误,但该错误已被忽略。 - 正在开始执行循环的次数为 {0} 次... + Beginning execution loop 不支持命令 {0}。 找不到变量 {0}。 SQL 执行错误︰ {0} diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hant.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hant.resx index 9bba3490..13755923 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hant.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.zh-hant.resx @@ -63,7 +63,7 @@ 在儲存工作啟動時,發生內部錯誤 相同路徑的儲存要求正在進行中 無法儲存 {0}: {1} - 無法讀取子集,除非已經從伺服器讀取結果 + 從伺服器讀取結果前,無法讀取子集 開始資料列不能小於 0 或大於結果集中的資料列總數 資料列計數必須是正整數 無法從結果集擷取資料行結構描述 @@ -79,8 +79,8 @@ 第 {0} 行位置超出資料行範圍 開始位置 ({0},{1}) 必須先於或等於結束位置 ({2},{3}) 訊息 {0},層級 {1} ,狀態 {2},第 {3} 行 - 訊息 {0} 層級 {1} 狀態 {2} 程序 {3}、 第 {4} 行 - Msg {0},層級 {1} 狀態 {2} + 訊息 {0} ,層級 {1}, 狀態 {2}, 程序 {3},第 {4} 行 + 訊息 {0},層級 {1} ,狀態 {2} 處理批次時,發生錯誤。錯誤訊息是︰ {0} ({0} 個資料列受到影響) 前一個執行尚未完成。 @@ -90,8 +90,8 @@ 已執行完成 {0} 次... 您已取消查詢。 執行此批次時發生錯誤。 - 執行批次,但被忽略的錯誤時,就會發生錯誤。 - 正在啟動 {0} 次執行迴圈... + 執行此批次時發生錯誤,但錯誤以忽略。 + Beginning execution loop 不支援命令 {0}。 找不到變數 {0}。 SQL 執行錯誤︰ {0} @@ -102,9 +102,9 @@ 正在取消批次剖析器包裝函式的批次執行。 指令碼警告。 有關此錯誤的詳細資訊,請參閱產品文件中的疑難排解主題。 - 檔案 '{0}' 被遞迴方式包含。 + 檔案 '{0}' 具有遞迴。 遺漏結束的註解記號 ' * /'。 - 未封閉的雙引號記號之後的字元字串。 + 字元字串後有未封閉的雙引號 正在剖析 {0} 時遇到不正確的語法。 未定義變數 {0}。 測試 diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs index 8fe4033b..9a6c5454 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs @@ -1,1632 +1,1632 @@ -// This file was generated by a T4 Template. Do not modify directly, instead update the SmoQueryModelDefinition.xml file -// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool", -// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen". - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Linq; -using Microsoft.SqlServer.Management.Smo; -using Microsoft.SqlServer.Management.Smo.Broker; - -namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel -{ - - [Export(typeof(SmoQuerier))] - internal partial class SqlDatabaseQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Database) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.Databases; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlLinkedServerLoginQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(LinkedServer) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.LinkedServers; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlLoginQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Login) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.Logins; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlServerRoleQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ServerRole) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.Roles; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlCredentialQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Credential) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.Credentials; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlCryptographicProviderQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(CryptographicProvider) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.CryptographicProviders; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlServerAuditQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Audit) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.Audits; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlServerAuditSpecificationQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ServerAuditSpecification) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.ServerAuditSpecifications; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlEndpointQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Endpoint) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.Endpoints; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlLinkedServerQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(LinkedServer) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.LinkedServers; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlServerDdlTriggerQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ServerDdlTrigger) }; - - public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } - - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.Triggers; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlErrorMessageQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(UserDefinedMessage) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Server parentServer = context.Parent as Server; - if (parentServer != null) - { - var retValue = parentServer.UserDefinedMessages; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlTableQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Table) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Tables; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlHistoryTableQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Table) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Table parentTable = context.Parent as Table; - if (parentTable != null) - { - var retValue = parentTable.Parent.Tables; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper
(retValue).Where(c => PassesFinalFilters(parentTable, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlViewQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(View) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Views; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlSynonymQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Synonym) }; - - public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } - - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Synonyms; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlColumnQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Column) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - TableViewTableTypeBase parentTableViewTableTypeBase = context.Parent as TableViewTableTypeBase; - if (parentTableViewTableTypeBase != null) - { - var retValue = parentTableViewTableTypeBase.Columns; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTableViewTableTypeBase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlIndexQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Index) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - TableViewTableTypeBase parentTableViewTableTypeBase = context.Parent as TableViewTableTypeBase; - if (parentTableViewTableTypeBase != null) - { - var retValue = parentTableViewTableTypeBase.Indexes; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTableViewTableTypeBase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlCheckQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Check) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Table parentTable = context.Parent as Table; - if (parentTable != null) - { - var retValue = parentTable.Checks; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTable, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlForeignKeyConstraintQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ForeignKey) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Table parentTable = context.Parent as Table; - if (parentTable != null) - { - var retValue = parentTable.ForeignKeys; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTable, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlDefaultConstraintQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(DefaultConstraint) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Column parentColumn = context.Parent as Column; - if (parentColumn != null) - { - var retValue = parentColumn.DefaultConstraint; - if (retValue != null) - { - if (refresh) - { - parentColumn.DefaultConstraint.Refresh(); - } - return new SqlSmoObject[] { retValue }; - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlDmlTriggerQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Trigger) }; - - public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } - - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Table parentTable = context.Parent as Table; - if (parentTable != null) - { - var retValue = parentTable.Triggers; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTable, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlFullTextIndexQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(FullTextIndex) }; - - public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } - - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Table parentTable = context.Parent as Table; - if (parentTable != null) - { - var retValue = parentTable.FullTextIndex; - if (retValue != null) - { - if (refresh) - { - parentTable.FullTextIndex.Refresh(); - } - return new SqlSmoObject[] { retValue }; - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlStatisticQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Statistic) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - TableViewBase parentTableViewBase = context.Parent as TableViewBase; - if (parentTableViewBase != null) - { - var retValue = parentTableViewBase.Statistics; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTableViewBase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlDatabaseDdlTriggerQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(DatabaseDdlTrigger) }; - - public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } - - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Triggers; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlAssemblyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(SqlAssembly) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Assemblies; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlSequenceQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Sequence) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Sequences; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlUserDefinedDataTypeQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(UserDefinedDataType) }; - - public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } - - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.UserDefinedDataTypes; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlUserDefinedTableTypeQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(UserDefinedTableType) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.UserDefinedTableTypes; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlXmlSchemaCollectionQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(XmlSchemaCollection) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.XmlSchemaCollections; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlUserDefinedTypeQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(UserDefinedType) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.UserDefinedTypes; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlUserDefinedFunctionQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(UserDefinedFunction) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.UserDefinedFunctions; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlUserDefinedAggregateQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(UserDefinedAggregate) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.UserDefinedAggregates; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlFileGroupQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(FileGroup) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.FileGroups; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlFileQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(DataFile) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - FileGroup parentFileGroup = context.Parent as FileGroup; - if (parentFileGroup != null) - { - var retValue = parentFileGroup.Files; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentFileGroup, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlFullTextCatalogQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(FullTextCatalog) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.FullTextCatalogs; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlFullTextStopListQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(FullTextStopList) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.FullTextStopLists; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlPartitionFunctionQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(PartitionFunction) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.PartitionFunctions; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlPartitionSchemeQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(PartitionScheme) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.PartitionSchemes; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlSearchPropertyListQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(SearchPropertyList) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.SearchPropertyLists; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlUserQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(User) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Users; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlSchemaQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Schema) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Schemas; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlAsymmetricKeyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(AsymmetricKey) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.AsymmetricKeys; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlCertificateQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Certificate) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Certificates; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlSymmetricKeyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(SymmetricKey) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.SymmetricKeys; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlDatabaseEncryptionKeyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(DatabaseEncryptionKey) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.DatabaseEncryptionKey; - if (retValue != null) - { - if (refresh) - { - parentDatabase.DatabaseEncryptionKey.Refresh(); - } - return new SqlSmoObject[] { retValue }; - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlMasterKeyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(MasterKey) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.MasterKey; - if (retValue != null) - { - if (refresh) - { - parentDatabase.MasterKey.Refresh(); - } - return new SqlSmoObject[] { retValue }; - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlDatabaseAuditSpecificationQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(DatabaseAuditSpecification) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.DatabaseAuditSpecifications; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlSecurityPolicyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(SecurityPolicy) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.SecurityPolicies; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlDatabaseCredentialQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(DatabaseScopedCredential) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.DatabaseScopedCredentials; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlRoleQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(DatabaseRole) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Roles; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlApplicationRoleQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ApplicationRole) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.ApplicationRoles; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlColumnMasterKeyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ColumnMasterKey) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.ColumnMasterKeys; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlColumnEncryptionKeyQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ColumnEncryptionKey) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.ColumnEncryptionKeys; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlServiceBrokerQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ServiceBroker) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.ServiceBroker; - if (retValue != null) - { - if (refresh) - { - parentDatabase.ServiceBroker.Refresh(); - } - return new SqlSmoObject[] { retValue }; - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlServiceQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(BrokerService) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; - if (parentServiceBroker != null) - { - var retValue = parentServiceBroker.Services; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlContractQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ServiceContract) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; - if (parentServiceBroker != null) - { - var retValue = parentServiceBroker.ServiceContracts; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlQueueQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ServiceQueue) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; - if (parentServiceBroker != null) - { - var retValue = parentServiceBroker.Queues; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlRemoteServiceBindingQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(RemoteServiceBinding) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; - if (parentServiceBroker != null) - { - var retValue = parentServiceBroker.RemoteServiceBindings; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlBrokerPriorityQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(BrokerPriority) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; - if (parentServiceBroker != null) - { - var retValue = parentServiceBroker.Priorities; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlMessageTypeQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(MessageType) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; - if (parentServiceBroker != null) - { - var retValue = parentServiceBroker.MessageTypes; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlExternalDataSourceQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ExternalDataSource) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.ExternalDataSources; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlExternalFileFormatQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ExternalFileFormat) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.ExternalFileFormats; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlProcedureQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(StoredProcedure) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.StoredProcedures; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlExtendedStoredProcedureQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(ExtendedStoredProcedure) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.ExtendedStoredProcedures; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlSubroutineParameterQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(Parameter) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - StoredProcedure parentStoredProcedure = context.Parent as StoredProcedure; - if (parentStoredProcedure != null) - { - var retValue = parentStoredProcedure.Parameters; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentStoredProcedure, c)); - } - } - UserDefinedAggregate parentUserDefinedAggregate = context.Parent as UserDefinedAggregate; - if (parentUserDefinedAggregate != null) - { - var retValue = parentUserDefinedAggregate.Parameters; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentUserDefinedAggregate, c)); - } - } - UserDefinedFunction parentUserDefinedFunction = context.Parent as UserDefinedFunction; - if (parentUserDefinedFunction != null) - { - var retValue = parentUserDefinedFunction.Parameters; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentUserDefinedFunction, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlPartitionFunctionParameterQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(PartitionFunctionParameter) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - PartitionFunction parentPartitionFunction = context.Parent as PartitionFunction; - if (parentPartitionFunction != null) - { - var retValue = parentPartitionFunction.PartitionFunctionParameters; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentPartitionFunction, c)); - } - } - return Enumerable.Empty(); - } - } - - [Export(typeof(SmoQuerier))] - internal partial class SqlBuiltInTypeQuerier: SmoQuerier - { - Type[] supportedTypes = new Type[] { typeof(SystemDataType) }; - - public override Type[] SupportedObjectTypes { get { return supportedTypes; } } - - public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) - { - Database parentDatabase = context.Parent as Database; - if (parentDatabase != null) - { - var retValue = parentDatabase.Parent.SystemDataTypes; - if (retValue != null) - { - retValue.ClearAndInitialize(filter, extraProperties); - return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); - } - } - return Enumerable.Empty(); - } - } -} - +// This file was generated by a T4 Template. Do not modify directly, instead update the SmoQueryModelDefinition.xml file +// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool", +// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen". + +using System; +using System.Collections.Generic; +using System.Composition; +using System.Linq; +using Microsoft.SqlServer.Management.Smo; +using Microsoft.SqlServer.Management.Smo.Broker; + +namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel +{ + + [Export(typeof(SmoQuerier))] + internal partial class SqlDatabaseQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Database) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.Databases; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlLinkedServerLoginQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(LinkedServer) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.LinkedServers; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlLoginQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Login) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.Logins; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlServerRoleQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ServerRole) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.Roles; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlCredentialQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Credential) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.Credentials; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlCryptographicProviderQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(CryptographicProvider) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.CryptographicProviders; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlServerAuditQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Audit) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.Audits; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlServerAuditSpecificationQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ServerAuditSpecification) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.ServerAuditSpecifications; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlEndpointQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Endpoint) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.Endpoints; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlLinkedServerQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(LinkedServer) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.LinkedServers; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlServerDdlTriggerQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ServerDdlTrigger) }; + + public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } + + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.Triggers; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlErrorMessageQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(UserDefinedMessage) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Server parentServer = context.Parent as Server; + if (parentServer != null) + { + var retValue = parentServer.UserDefinedMessages; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServer, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlTableQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Table) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Tables; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper
(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlHistoryTableQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Table) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Table parentTable = context.Parent as Table; + if (parentTable != null) + { + var retValue = parentTable.Parent.Tables; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper
(retValue).Where(c => PassesFinalFilters(parentTable, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlViewQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(View) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Views; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlSynonymQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Synonym) }; + + public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } + + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Synonyms; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlColumnQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Column) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + TableViewTableTypeBase parentTableViewTableTypeBase = context.Parent as TableViewTableTypeBase; + if (parentTableViewTableTypeBase != null) + { + var retValue = parentTableViewTableTypeBase.Columns; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTableViewTableTypeBase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlIndexQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Index) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + TableViewTableTypeBase parentTableViewTableTypeBase = context.Parent as TableViewTableTypeBase; + if (parentTableViewTableTypeBase != null) + { + var retValue = parentTableViewTableTypeBase.Indexes; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTableViewTableTypeBase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlCheckQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Check) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Table parentTable = context.Parent as Table; + if (parentTable != null) + { + var retValue = parentTable.Checks; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTable, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlForeignKeyConstraintQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ForeignKey) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Table parentTable = context.Parent as Table; + if (parentTable != null) + { + var retValue = parentTable.ForeignKeys; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTable, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlDefaultConstraintQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(DefaultConstraint) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Column parentColumn = context.Parent as Column; + if (parentColumn != null) + { + var retValue = parentColumn.DefaultConstraint; + if (retValue != null) + { + if (refresh) + { + parentColumn.DefaultConstraint.Refresh(); + } + return new SqlSmoObject[] { retValue }; + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlDmlTriggerQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Trigger) }; + + public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } + + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Table parentTable = context.Parent as Table; + if (parentTable != null) + { + var retValue = parentTable.Triggers; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTable, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlFullTextIndexQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(FullTextIndex) }; + + public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } + + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Table parentTable = context.Parent as Table; + if (parentTable != null) + { + var retValue = parentTable.FullTextIndex; + if (retValue != null) + { + if (refresh) + { + parentTable.FullTextIndex.Refresh(); + } + return new SqlSmoObject[] { retValue }; + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlStatisticQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Statistic) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + TableViewBase parentTableViewBase = context.Parent as TableViewBase; + if (parentTableViewBase != null) + { + var retValue = parentTableViewBase.Statistics; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTableViewBase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlDatabaseDdlTriggerQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(DatabaseDdlTrigger) }; + + public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } + + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Triggers; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlAssemblyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(SqlAssembly) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Assemblies; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlSequenceQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Sequence) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Sequences; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlUserDefinedDataTypeQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(UserDefinedDataType) }; + + public override ValidForFlag ValidFor { get { return ValidForFlag.NotSqlDw; } } + + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.UserDefinedDataTypes; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlUserDefinedTableTypeQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(UserDefinedTableType) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.UserDefinedTableTypes; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlXmlSchemaCollectionQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(XmlSchemaCollection) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.XmlSchemaCollections; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlUserDefinedTypeQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(UserDefinedType) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.UserDefinedTypes; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlUserDefinedFunctionQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(UserDefinedFunction) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.UserDefinedFunctions; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlUserDefinedAggregateQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(UserDefinedAggregate) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.UserDefinedAggregates; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlFileGroupQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(FileGroup) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.FileGroups; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlFileQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(DataFile) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + FileGroup parentFileGroup = context.Parent as FileGroup; + if (parentFileGroup != null) + { + var retValue = parentFileGroup.Files; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentFileGroup, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlFullTextCatalogQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(FullTextCatalog) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.FullTextCatalogs; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlFullTextStopListQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(FullTextStopList) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.FullTextStopLists; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlPartitionFunctionQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(PartitionFunction) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.PartitionFunctions; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlPartitionSchemeQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(PartitionScheme) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.PartitionSchemes; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlSearchPropertyListQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(SearchPropertyList) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.SearchPropertyLists; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlUserQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(User) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Users; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlSchemaQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Schema) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Schemas; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlAsymmetricKeyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(AsymmetricKey) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.AsymmetricKeys; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlCertificateQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Certificate) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Certificates; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlSymmetricKeyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(SymmetricKey) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.SymmetricKeys; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlDatabaseEncryptionKeyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(DatabaseEncryptionKey) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.DatabaseEncryptionKey; + if (retValue != null) + { + if (refresh) + { + parentDatabase.DatabaseEncryptionKey.Refresh(); + } + return new SqlSmoObject[] { retValue }; + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlMasterKeyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(MasterKey) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.MasterKey; + if (retValue != null) + { + if (refresh) + { + parentDatabase.MasterKey.Refresh(); + } + return new SqlSmoObject[] { retValue }; + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlDatabaseAuditSpecificationQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(DatabaseAuditSpecification) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.DatabaseAuditSpecifications; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlSecurityPolicyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(SecurityPolicy) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.SecurityPolicies; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlDatabaseCredentialQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(DatabaseScopedCredential) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.DatabaseScopedCredentials; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlRoleQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(DatabaseRole) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Roles; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlApplicationRoleQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ApplicationRole) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.ApplicationRoles; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlColumnMasterKeyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ColumnMasterKey) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.ColumnMasterKeys; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlColumnEncryptionKeyQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ColumnEncryptionKey) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.ColumnEncryptionKeys; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlServiceBrokerQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ServiceBroker) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.ServiceBroker; + if (retValue != null) + { + if (refresh) + { + parentDatabase.ServiceBroker.Refresh(); + } + return new SqlSmoObject[] { retValue }; + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlServiceQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(BrokerService) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; + if (parentServiceBroker != null) + { + var retValue = parentServiceBroker.Services; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlContractQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ServiceContract) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; + if (parentServiceBroker != null) + { + var retValue = parentServiceBroker.ServiceContracts; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlQueueQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ServiceQueue) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; + if (parentServiceBroker != null) + { + var retValue = parentServiceBroker.Queues; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlRemoteServiceBindingQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(RemoteServiceBinding) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; + if (parentServiceBroker != null) + { + var retValue = parentServiceBroker.RemoteServiceBindings; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlBrokerPriorityQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(BrokerPriority) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; + if (parentServiceBroker != null) + { + var retValue = parentServiceBroker.Priorities; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlMessageTypeQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(MessageType) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + ServiceBroker parentServiceBroker = context.Parent as ServiceBroker; + if (parentServiceBroker != null) + { + var retValue = parentServiceBroker.MessageTypes; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentServiceBroker, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlExternalDataSourceQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ExternalDataSource) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.ExternalDataSources; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlExternalFileFormatQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ExternalFileFormat) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.ExternalFileFormats; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlProcedureQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(StoredProcedure) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.StoredProcedures; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlExtendedStoredProcedureQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(ExtendedStoredProcedure) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.ExtendedStoredProcedures; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlSubroutineParameterQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(Parameter) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + StoredProcedure parentStoredProcedure = context.Parent as StoredProcedure; + if (parentStoredProcedure != null) + { + var retValue = parentStoredProcedure.Parameters; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentStoredProcedure, c)); + } + } + UserDefinedAggregate parentUserDefinedAggregate = context.Parent as UserDefinedAggregate; + if (parentUserDefinedAggregate != null) + { + var retValue = parentUserDefinedAggregate.Parameters; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentUserDefinedAggregate, c)); + } + } + UserDefinedFunction parentUserDefinedFunction = context.Parent as UserDefinedFunction; + if (parentUserDefinedFunction != null) + { + var retValue = parentUserDefinedFunction.Parameters; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentUserDefinedFunction, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlPartitionFunctionParameterQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(PartitionFunctionParameter) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + PartitionFunction parentPartitionFunction = context.Parent as PartitionFunction; + if (parentPartitionFunction != null) + { + var retValue = parentPartitionFunction.PartitionFunctionParameters; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentPartitionFunction, c)); + } + } + return Enumerable.Empty(); + } + } + + [Export(typeof(SmoQuerier))] + internal partial class SqlBuiltInTypeQuerier: SmoQuerier + { + Type[] supportedTypes = new Type[] { typeof(SystemDataType) }; + + public override Type[] SupportedObjectTypes { get { return supportedTypes; } } + + public override IEnumerable Query(SmoQueryContext context, string filter, bool refresh, IEnumerable extraProperties) + { + Database parentDatabase = context.Parent as Database; + if (parentDatabase != null) + { + var retValue = parentDatabase.Parent.SystemDataTypes; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentDatabase, c)); + } + } + return Enumerable.Empty(); + } + } +} + diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTableCustomNode.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTableCustomNode.cs index 314ae07f..db43ab7a 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTableCustomNode.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTableCustomNode.cs @@ -21,6 +21,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { return $"{table.Schema}.{table.Name} ({SR.SystemVersioned_LabelPart})"; } + else if (table != null && IsPropertySupported("IsExternal", smoContext, table, CachedSmoProperties) && table.IsExternal) + { + return $"{table.Schema}.{table.Name} ({SR.External_LabelPart})"; + } + else if (table != null && IsPropertySupported("IsFileTable", smoContext, table, CachedSmoProperties) && table.IsFileTable) + { + return $"{table.Schema}.{table.Name} ({SR.FileTable_LabelPart})"; + } } catch { @@ -39,6 +47,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { return "Temporal"; } + // TODO carbon issue 3125 enable "External" subtype once icon is ready. Otherwise will get missing icon here. + // else if (table != null && IsPropertySupported("IsExternal", smoContext, table, CachedSmoProperties) && table.IsExternal) + // { + // return "External"; + // } // return string.Empty; } diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml index e0ea4c05..a66d533e 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml @@ -79,8 +79,10 @@ + + diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs index 5fe4a6e2..3bac4b0b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs @@ -1,3991 +1,4001 @@ -using System; -using System.Collections.Generic; -using System.Composition; -using Microsoft.SqlServer.Management.Smo; -using Microsoft.SqlTools.ServiceLayer; -using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; - -namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel -{ - - internal sealed partial class DatabaseTreeNode : SmoTreeNode - { - public DatabaseTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "Database"; - this.NodeTypeId = NodeTypes.Database; - OnInitialize(); - } - } - - internal sealed partial class TableTreeNode : SmoTreeNode - { - public TableTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "Table"; - this.NodeTypeId = NodeTypes.Table; - OnInitialize(); - } - } - - internal sealed partial class ViewTreeNode : SmoTreeNode - { - public ViewTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "View"; - this.NodeTypeId = NodeTypes.View; - OnInitialize(); - } - } - - internal sealed partial class UserDefinedTableTypeTreeNode : SmoTreeNode - { - public UserDefinedTableTypeTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "UserDefinedTableType"; - this.NodeTypeId = NodeTypes.UserDefinedTableType; - OnInitialize(); - } - } - - internal sealed partial class StoredProcedureTreeNode : SmoTreeNode - { - public StoredProcedureTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "StoredProcedure"; - this.NodeTypeId = NodeTypes.StoredProcedure; - OnInitialize(); - } - } - - internal sealed partial class TableValuedFunctionTreeNode : SmoTreeNode - { - public TableValuedFunctionTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "TableValuedFunction"; - this.NodeTypeId = NodeTypes.TableValuedFunction; - OnInitialize(); - } - } - - internal sealed partial class ScalarValuedFunctionTreeNode : SmoTreeNode - { - public ScalarValuedFunctionTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "ScalarValuedFunction"; - this.NodeTypeId = NodeTypes.ScalarValuedFunction; - OnInitialize(); - } - } - - internal sealed partial class AggregateFunctionTreeNode : SmoTreeNode - { - public AggregateFunctionTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "AggregateFunction"; - this.NodeTypeId = NodeTypes.AggregateFunction; - OnInitialize(); - } - } - - internal sealed partial class FileGroupTreeNode : SmoTreeNode - { - public FileGroupTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "FileGroup"; - this.NodeTypeId = NodeTypes.FileGroup; - OnInitialize(); - } - } - - internal sealed partial class ExternalTableTreeNode : SmoTreeNode - { - public ExternalTableTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "ExternalTable"; - this.NodeTypeId = NodeTypes.ExternalTable; - OnInitialize(); - } - } - - internal sealed partial class ExternalResourceTreeNode : SmoTreeNode - { - public ExternalResourceTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "ExternalResource"; - this.NodeTypeId = NodeTypes.ExternalResource; - OnInitialize(); - } - } - - internal sealed partial class HistoryTableTreeNode : SmoTreeNode - { - public HistoryTableTreeNode() : base() - { - NodeValue = string.Empty; - this.NodeType = "HistoryTable"; - this.NodeTypeId = NodeTypes.HistoryTable; - OnInitialize(); - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Server" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Databases, - NodeType = "Folder", - NodeTypeId = NodeTypes.Databases, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Security, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelSecurity, - IsSystemObject = false, - ValidFor = ValidForFlag.All, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ServerObjects, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelServerObjects, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class DatabasesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Databases" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 0 }, - }); - return filters; - } - } - - public override IEnumerable SmoProperties - { - get - { - var properties = new List(); - properties.Add(new NodeSmoProperty - { - Name = "Status", - ValidFor = ValidForFlag.All - }); - return properties; - } - } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemDatabases, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemDatabases, - IsSystemObject = true, - ValidFor = ValidForFlag.All, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDatabaseQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new DatabaseTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelSecurityChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelSecurity" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_LinkedServerLogins, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelLinkedServerLogins, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Logins, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelLogins, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ServerRoles, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelServerRoles, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Credentials, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelCredentials, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_CryptographicProviders, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelCryptographicProviders, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ServerAudits, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelServerAudits, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ServerAuditSpecifications, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelServerAuditSpecifications, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelServerObjectsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerObjects" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Endpoints, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelEndpoints, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_LinkedServers, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelLinkedServers, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ServerTriggers, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelServerTriggers, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ErrorMessages, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServerLevelErrorMessages, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemDatabasesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemDatabases" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 1 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDatabaseQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new DatabaseTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelLinkedServerLoginsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelLinkedServerLogins" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlLinkedServerLoginQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelLinkedServerLogin"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelLoginsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelLogins" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlLoginQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelLogin"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelServerRolesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerRoles" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlServerRoleQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelServerRole"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelCredentialsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelCredentials" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlCredentialQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelCredential"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelCryptographicProvidersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelCryptographicProviders" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlCryptographicProviderQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelCryptographicProvider"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelServerAuditsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerAudits" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlServerAuditQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelServerAudit"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelServerAuditSpecificationsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerAuditSpecifications" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlServerAuditSpecificationQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelServerAuditSpecification"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelEndpointsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelEndpoints" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlEndpointQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelEndpoint"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelLinkedServersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelLinkedServers" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlLinkedServerQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelLinkedServer"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelServerTriggersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerTriggers" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlServerDdlTriggerQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelServerTrigger"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServerLevelErrorMessagesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServerLevelErrorMessages" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlErrorMessageQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ServerLevelErrorMessage"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class DatabaseChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Database" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Tables, - NodeType = "Folder", - NodeTypeId = NodeTypes.Tables, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Views, - NodeType = "Folder", - NodeTypeId = NodeTypes.Views, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Synonyms, - NodeType = "Folder", - NodeTypeId = NodeTypes.Synonyms, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Programmability, - NodeType = "Folder", - NodeTypeId = NodeTypes.Programmability, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ExternalResources, - NodeType = "Folder", - NodeTypeId = NodeTypes.ExternalResources, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ServiceBroker, - NodeType = "Folder", - NodeTypeId = NodeTypes.ServiceBroker, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Storage, - NodeType = "Folder", - NodeTypeId = NodeTypes.Storage, - IsSystemObject = false, - ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Security, - NodeType = "Folder", - NodeTypeId = NodeTypes.Security, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Database"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class TablesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Tables" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 0 }, - }); - filters.Add(new NodeFilter - { - Property = "TemporalType", - Type = typeof(Enum), - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - Values = new List - { - { TableTemporalType.None }, - { TableTemporalType.SystemVersioned } - } - }); - return filters; - } - } - - public override IEnumerable SmoProperties - { - get - { - var properties = new List(); - properties.Add(new NodeSmoProperty - { - Name = "IsSystemVersioned", - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12 - }); - properties.Add(new NodeSmoProperty - { - Name = "TemporalType", - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12 - }); - return properties; - } - } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemTables, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemTables, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlTableQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new TableTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ViewsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Views" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 0 }, - }); - return filters; - } - } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemViews, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemViews, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlViewQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new ViewTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SynonymsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Synonyms" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSynonymQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Synonym"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ProgrammabilityChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Programmability" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_StoredProcedures, - NodeType = "Folder", - NodeTypeId = NodeTypes.StoredProcedures, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Functions, - NodeType = "Folder", - NodeTypeId = NodeTypes.Functions, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_DatabaseTriggers, - NodeType = "Folder", - NodeTypeId = NodeTypes.DatabaseTriggers, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Assemblies, - NodeType = "Folder", - NodeTypeId = NodeTypes.Assemblies, - IsSystemObject = false, - ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Types, - NodeType = "Folder", - NodeTypeId = NodeTypes.Types, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Sequences, - NodeType = "Folder", - NodeTypeId = NodeTypes.Sequences, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ExternalResourcesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ExternalResources" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ExternalDataSources, - NodeType = "Folder", - NodeTypeId = NodeTypes.ExternalDataSources, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ExternalFileFormats, - NodeType = "Folder", - NodeTypeId = NodeTypes.ExternalFileFormats, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServiceBrokerChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ServiceBroker" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_MessageTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.MessageTypes, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Contracts, - NodeType = "Folder", - NodeTypeId = NodeTypes.Contracts, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Queues, - NodeType = "Folder", - NodeTypeId = NodeTypes.Queues, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Services, - NodeType = "Folder", - NodeTypeId = NodeTypes.Services, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_RemoteServiceBindings, - NodeType = "Folder", - NodeTypeId = NodeTypes.RemoteServiceBindings, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_BrokerPriorities, - NodeType = "Folder", - NodeTypeId = NodeTypes.BrokerPriorities, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class StorageChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Storage" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_FileGroups, - NodeType = "Folder", - NodeTypeId = NodeTypes.FileGroups, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_FullTextCatalogs, - NodeType = "Folder", - NodeTypeId = NodeTypes.FullTextCatalogs, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_FullTextStopLists, - NodeType = "Folder", - NodeTypeId = NodeTypes.FullTextStopLists, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_LogFiles, - NodeType = "Folder", - NodeTypeId = NodeTypes.SqlLogFiles, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_PartitionFunctions, - NodeType = "Folder", - NodeTypeId = NodeTypes.PartitionFunctions, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_PartitionSchemes, - NodeType = "Folder", - NodeTypeId = NodeTypes.PartitionSchemes, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SearchPropertyLists, - NodeType = "Folder", - NodeTypeId = NodeTypes.SearchPropertyLists, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SecurityChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Security" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Users, - NodeType = "Folder", - NodeTypeId = NodeTypes.Users, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Roles, - NodeType = "Folder", - NodeTypeId = NodeTypes.Roles, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Schemas, - NodeType = "Folder", - NodeTypeId = NodeTypes.Schemas, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_AsymmetricKeys, - NodeType = "Folder", - NodeTypeId = NodeTypes.AsymmetricKeys, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Certificates, - NodeType = "Folder", - NodeTypeId = NodeTypes.Certificates, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SymmetricKeys, - NodeType = "Folder", - NodeTypeId = NodeTypes.SymmetricKeys, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_DatabaseScopedCredentials, - NodeType = "Folder", - NodeTypeId = NodeTypes.DatabaseScopedCredentials, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_DatabaseEncryptionKeys, - NodeType = "Folder", - NodeTypeId = NodeTypes.DatabaseEncryptionKeys, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_MasterKeys, - NodeType = "Folder", - NodeTypeId = NodeTypes.MasterKeys, - IsSystemObject = false, - ValidFor = ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_DatabaseAuditSpecifications, - NodeType = "Folder", - NodeTypeId = NodeTypes.DatabaseAuditSpecifications, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SecurityPolicies, - NodeType = "Folder", - NodeTypeId = NodeTypes.SecurityPolicies, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_AlwaysEncryptedKeys, - NodeType = "Folder", - NodeTypeId = NodeTypes.AlwaysEncryptedKeys, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemTablesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemTables" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 1 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlTableQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new TableTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class TableChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Table" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "TemporalType", - Type = typeof(Enum), - TypeToReverse = typeof(SqlHistoryTableQuerier), - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - Values = new List - { - { TableTemporalType.HistoryTable } - } - }); - return filters; - } - } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Columns, - NodeType = "Folder", - NodeTypeId = NodeTypes.Columns, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Keys, - NodeType = "Folder", - NodeTypeId = NodeTypes.Keys, - IsSystemObject = false, - ValidFor = ValidForFlag.NotSqlDw, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Constraints, - NodeType = "Folder", - NodeTypeId = NodeTypes.Constraints, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Triggers, - NodeType = "Folder", - NodeTypeId = NodeTypes.Triggers, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Indexes, - NodeType = "Folder", - NodeTypeId = NodeTypes.Indexes, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Statistics, - NodeType = "Folder", - NodeTypeId = NodeTypes.Statistics, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlTableQuerier), typeof(SqlHistoryTableQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new HistoryTableTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class HistoryTableChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "HistoryTable" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Columns, - NodeType = "Folder", - NodeTypeId = NodeTypes.Columns, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Constraints, - NodeType = "Folder", - NodeTypeId = NodeTypes.Constraints, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Indexes, - NodeType = "Folder", - NodeTypeId = NodeTypes.Indexes, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Statistics, - NodeType = "Folder", - NodeTypeId = NodeTypes.Statistics, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Table"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ExternalTableChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ExternalTable" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Columns, - NodeType = "Folder", - NodeTypeId = NodeTypes.Columns, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Statistics, - NodeType = "Folder", - NodeTypeId = NodeTypes.Statistics, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlTableQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Table"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ColumnsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Columns" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlColumnQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Column"; - child.SortPriority = SmoTreeNode.NextSortPriority; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class KeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Keys" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IndexKeyType", - Type = typeof(Enum), - TypeToReverse = typeof(SqlIndexQuerier), - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - Values = new List - { - { IndexKeyType.DriPrimaryKey }, - { IndexKeyType.DriUniqueKey } - } - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlIndexQuerier), typeof(SqlForeignKeyConstraintQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Key"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ConstraintsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Constraints" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDefaultConstraintQuerier), typeof(SqlCheckQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Constraint"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class TriggersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Triggers" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDmlTriggerQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Trigger"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class IndexesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Indexes" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IndexKeyType", - Type = typeof(Enum), - TypeToReverse = typeof(SqlIndexQuerier), - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - Values = new List - { - { IndexKeyType.None }, - { IndexKeyType.DriPrimaryKey }, - { IndexKeyType.DriUniqueKey } - } - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlIndexQuerier), typeof(SqlFullTextIndexQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Index"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class StatisticsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Statistics" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlStatisticQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Statistic"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemViewsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemViews" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 1 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlViewQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new ViewTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ViewChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "View" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Columns, - NodeType = "Folder", - NodeTypeId = NodeTypes.Columns, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Triggers, - NodeType = "Folder", - NodeTypeId = NodeTypes.Triggers, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Indexes, - NodeType = "Folder", - NodeTypeId = NodeTypes.Indexes, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Statistics, - NodeType = "Folder", - NodeTypeId = NodeTypes.Statistics, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "View"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class FunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Functions" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemFunctions, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemFunctions, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_TableValuedFunctions, - NodeType = "Folder", - NodeTypeId = NodeTypes.TableValuedFunctions, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ScalarValuedFunctions, - NodeType = "Folder", - NodeTypeId = NodeTypes.ScalarValuedFunctions, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_AggregateFunctions, - NodeType = "Folder", - NodeTypeId = NodeTypes.AggregateFunctions, - IsSystemObject = false, - ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemFunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemFunctions" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_TableValuedFunctions, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemTableValuedFunctions, - IsSystemObject = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ScalarValuedFunctions, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemScalarValuedFunctions, - IsSystemObject = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new TableValuedFunctionTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class DatabaseTriggersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "DatabaseTriggers" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDatabaseDdlTriggerQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "DatabaseTrigger"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class AssembliesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Assemblies" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlAssemblyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Assembly"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class TypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Types" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemDataTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemDataTypes, - IsSystemObject = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_UserDefinedDataTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.UserDefinedDataTypes, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_UserDefinedTableTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.UserDefinedTableTypes, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_UserDefinedTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.UserDefinedTypes, - IsSystemObject = false, - ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_XMLSchemaCollections, - NodeType = "Folder", - NodeTypeId = NodeTypes.XmlSchemaCollections, - IsSystemObject = false, - ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SequencesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Sequences" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSequenceQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Sequence"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemDataTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemDataTypes" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemExactNumerics, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemExactNumerics, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemApproximateNumerics, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemApproximateNumerics, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemDateAndTime, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemDateAndTimes, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemCharacterStrings, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemCharacterStrings, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemUnicodeCharacterStrings, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemUnicodeCharacterStrings, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemBinaryStrings, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemBinaryStrings, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemOtherDataTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemOtherDataTypes, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemCLRDataTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemClrDataTypes, - IsSystemObject = false, - ValidFor = ValidForFlag.All, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemSpatialDataTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemSpatialDataTypes, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UserDefinedDataTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "UserDefinedDataTypes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedDataTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "UserDefinedDataType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UserDefinedTableTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedTableTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new UserDefinedTableTypeTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UserDefinedTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTypes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "UserDefinedType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class XmlSchemaCollectionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "XmlSchemaCollections" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlXmlSchemaCollectionQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "XmlSchemaCollection"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UserDefinedTableTypeChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableType" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Columns, - NodeType = "Folder", - NodeTypeId = NodeTypes.UserDefinedTableTypeColumns, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Keys, - NodeType = "Folder", - NodeTypeId = NodeTypes.UserDefinedTableTypeKeys, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Constraints, - NodeType = "Folder", - NodeTypeId = NodeTypes.UserDefinedTableTypeConstraints, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "UserDefinedTableType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UserDefinedTableTypeColumnsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypeColumns" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlColumnQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "UserDefinedTableTypeColumn"; - child.SortPriority = SmoTreeNode.NextSortPriority; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UserDefinedTableTypeKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypeKeys" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IndexKeyType", - Type = typeof(Enum), - TypeToReverse = typeof(SqlIndexQuerier), - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - Values = new List - { - { IndexKeyType.DriPrimaryKey }, - { IndexKeyType.DriUniqueKey } - } - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlIndexQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "UserDefinedTableTypeKey"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UserDefinedTableTypeConstraintsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypeConstraints" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDefaultConstraintQuerier), typeof(SqlCheckQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "UserDefinedTableTypeConstraint"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemExactNumericsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemExactNumerics" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemExactNumeric"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemApproximateNumericsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemApproximateNumerics" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemApproximateNumeric"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemDateAndTimesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemDateAndTimes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemDateAndTime"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemCharacterStringsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemCharacterStrings" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemCharacterString"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemUnicodeCharacterStringsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemUnicodeCharacterStrings" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemUnicodeCharacterString"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemBinaryStringsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemBinaryStrings" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemBinaryString"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemOtherDataTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemOtherDataTypes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemOtherDataType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemClrDataTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemClrDataTypes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemClrDataType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemSpatialDataTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemSpatialDataTypes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBuiltInTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemSpatialDataType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ExternalDataSourcesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ExternalDataSources" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlExternalDataSourceQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ExternalDataSource"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ExternalFileFormatsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ExternalFileFormats" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlExternalFileFormatQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ExternalFileFormat"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class StoredProceduresChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "StoredProcedures" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 0 }, - }); - return filters; - } - } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemStoredProcedures, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemStoredProcedures, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlProcedureQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new StoredProcedureTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemStoredProceduresChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemStoredProcedures" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 1 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlProcedureQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new StoredProcedureTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class StoredProcedureChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "StoredProcedure" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Parameters, - NodeType = "Folder", - NodeTypeId = NodeTypes.StoredProcedureParameters, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "StoredProcedure"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class StoredProcedureParametersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "StoredProcedureParameters" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSubroutineParameterQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "StoredProcedureParameter"; - child.SortPriority = SmoTreeNode.NextSortPriority; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class TableValuedFunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "TableValuedFunctions" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "FunctionType", - Type = typeof(Enum), - Values = new List - { - { UserDefinedFunctionType.Table } - } - }); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 0 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedFunctionQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new TableValuedFunctionTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemTableValuedFunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemTableValuedFunctions" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "FunctionType", - Type = typeof(Enum), - Values = new List - { - { UserDefinedFunctionType.Table } - } - }); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 1 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedFunctionQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new TableValuedFunctionTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class TableValuedFunctionChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "TableValuedFunction" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Parameters, - NodeType = "Folder", - NodeTypeId = NodeTypes.TableValuedFunctionParameters, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "TableValuedFunction"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class TableValuedFunctionParametersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "TableValuedFunctionParameters" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSubroutineParameterQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "TableValuedFunctionParameter"; - child.SortPriority = SmoTreeNode.NextSortPriority; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ScalarValuedFunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ScalarValuedFunctions" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "FunctionType", - Type = typeof(Enum), - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - Values = new List - { - { UserDefinedFunctionType.Scalar } - } - }); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 0 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedFunctionQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new ScalarValuedFunctionTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemScalarValuedFunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemScalarValuedFunctions" }; } - - public override IEnumerable Filters - { - get - { - var filters = new List(); - filters.Add(new NodeFilter - { - Property = "FunctionType", - Type = typeof(Enum), - Values = new List - { - { UserDefinedFunctionType.Scalar } - } - }); - filters.Add(new NodeFilter - { - Property = "IsSystemObject", - Type = typeof(bool), - Values = new List { 1 }, - }); - return filters; - } - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedFunctionQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new ScalarValuedFunctionTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ScalarValuedFunctionChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ScalarValuedFunction" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Parameters, - NodeType = "Folder", - NodeTypeId = NodeTypes.ScalarValuedFunctionParameters, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ScalarValuedFunction"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ScalarValuedFunctionParametersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ScalarValuedFunctionParameters" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSubroutineParameterQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ScalarValuedFunctionParameter"; - child.SortPriority = SmoTreeNode.NextSortPriority; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class AggregateFunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "AggregateFunctions" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserDefinedAggregateQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new AggregateFunctionTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class AggregateFunctionChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "AggregateFunction" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_Parameters, - NodeType = "Folder", - NodeTypeId = NodeTypes.AggregateFunctionParameters, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new Type[0]; } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "AggregateFunction"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class AggregateFunctionParametersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "AggregateFunctionParameters" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSubroutineParameterQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "AggregateFunctionParameter"; - child.SortPriority = SmoTreeNode.NextSortPriority; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class RemoteServiceBindingsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "RemoteServiceBindings" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlRemoteServiceBindingQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "RemoteServiceBinding"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class BrokerPrioritiesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "BrokerPriorities" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlBrokerPriorityQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "BrokerPriority"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class FileGroupsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "FileGroups" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlFileGroupQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new FileGroupTreeNode(); - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class FullTextCatalogsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "FullTextCatalogs" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlFullTextCatalogQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "FullTextCatalog"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class FullTextStopListsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "FullTextStopLists" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlFullTextStopListQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "FullTextStopList"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SqlLogFilesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SqlLogFiles" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlFileQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SqlLogFile"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class PartitionFunctionsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "PartitionFunctions" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlPartitionFunctionQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "PartitionFunction"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class PartitionSchemesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "PartitionSchemes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlPartitionSchemeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "PartitionScheme"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SearchPropertyListsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SearchPropertyLists" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSearchPropertyListQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SearchPropertyList"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class FileGroupChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "FileGroup" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_FilegroupFiles, - NodeType = "Folder", - NodeTypeId = NodeTypes.FileGroupFiles, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class FileGroupFilesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "FileGroupFiles" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlFileQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "FileGroupFile"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class UsersChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Users" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlUserQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "User"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class RolesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Roles" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_DatabaseRoles, - NodeType = "Folder", - NodeTypeId = NodeTypes.DatabaseRoles, - IsSystemObject = false, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ApplicationRoles, - NodeType = "Folder", - NodeTypeId = NodeTypes.ApplicationRoles, - IsSystemObject = false, - ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SchemasChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Schemas" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSchemaQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Schema"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class AsymmetricKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "AsymmetricKeys" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlAsymmetricKeyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "AsymmetricKey"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class CertificatesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Certificates" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlCertificateQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Certificate"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SymmetricKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SymmetricKeys" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSymmetricKeyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SymmetricKey"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class DatabaseEncryptionKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "DatabaseEncryptionKeys" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDatabaseEncryptionKeyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "DatabaseEncryptionKey"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class MasterKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "MasterKeys" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlMasterKeyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "MasterKey"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class DatabaseAuditSpecificationsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "DatabaseAuditSpecifications" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDatabaseAuditSpecificationQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "DatabaseAuditSpecification"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SecurityPoliciesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SecurityPolicies" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlSecurityPolicyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SecurityPolicie"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class DatabaseScopedCredentialsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "DatabaseScopedCredentials" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlDatabaseCredentialQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "DatabaseScopedCredential"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class AlwaysEncryptedKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "AlwaysEncryptedKeys" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ColumnMasterKeys, - NodeType = "Folder", - NodeTypeId = NodeTypes.ColumnMasterKeys, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_ColumnEncryptionKeys, - NodeType = "Folder", - NodeTypeId = NodeTypes.ColumnEncryptionKeys, - IsSystemObject = false, - ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes { get {return null;} } - - - public override TreeNode CreateChild(TreeNode parent, object context) - { - return null; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class DatabaseRolesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "DatabaseRoles" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlRoleQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "DatabaseRole"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ApplicationRolesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ApplicationRoles" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlApplicationRoleQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ApplicationRole"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ColumnMasterKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ColumnMasterKeys" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlColumnMasterKeyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ColumnMasterKey"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ColumnEncryptionKeysChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "ColumnEncryptionKeys" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlColumnEncryptionKeyQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "ColumnEncryptionKey"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class MessageTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "MessageTypes" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemMessageTypes, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemMessageTypes, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlMessageTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "MessageType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemMessageTypesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemMessageTypes" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlMessageTypeQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemMessageType"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ContractsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Contracts" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemContracts, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemContracts, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlContractQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Contract"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemContractsChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemContracts" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlContractQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemContract"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class QueuesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Queues" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemQueues, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemQueues, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlQueueQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Queue"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemQueuesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemQueues" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlQueueQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemQueue"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class ServicesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "Services" }; } - - protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) - { - currentChildren.Add(new FolderNode { - NodeValue = SR.SchemaHierarchy_SystemServices, - NodeType = "Folder", - NodeTypeId = NodeTypes.SystemServices, - IsSystemObject = true, - IsMsShippedOwned = true, - SortPriority = SmoTreeNode.NextSortPriority, - }); - } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlServiceQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "Service"; - InitializeChild(parent, child, context); - return child; - } - } - - [Export(typeof(ChildFactory))] - [Shared] - internal partial class SystemServicesChildFactory : SmoChildFactoryBase - { - public override IEnumerable ApplicableParents() { return new[] { "SystemServices" }; } - - internal override Type[] ChildQuerierTypes - { - get - { - return new [] { typeof(SqlServiceQuerier), }; - } - } - - public override TreeNode CreateChild(TreeNode parent, object context) - { - var child = new SmoTreeNode(); - child.IsAlwaysLeaf = true; - child.NodeType = "SystemService"; - InitializeChild(parent, child, context); - return child; - } - } - -} - +using System; +using System.Collections.Generic; +using System.Composition; +using Microsoft.SqlServer.Management.Smo; +using Microsoft.SqlTools.ServiceLayer; +using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; + +namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel +{ + + internal sealed partial class DatabaseTreeNode : SmoTreeNode + { + public DatabaseTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "Database"; + this.NodeTypeId = NodeTypes.Database; + OnInitialize(); + } + } + + internal sealed partial class TableTreeNode : SmoTreeNode + { + public TableTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "Table"; + this.NodeTypeId = NodeTypes.Table; + OnInitialize(); + } + } + + internal sealed partial class ViewTreeNode : SmoTreeNode + { + public ViewTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "View"; + this.NodeTypeId = NodeTypes.View; + OnInitialize(); + } + } + + internal sealed partial class UserDefinedTableTypeTreeNode : SmoTreeNode + { + public UserDefinedTableTypeTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "UserDefinedTableType"; + this.NodeTypeId = NodeTypes.UserDefinedTableType; + OnInitialize(); + } + } + + internal sealed partial class StoredProcedureTreeNode : SmoTreeNode + { + public StoredProcedureTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "StoredProcedure"; + this.NodeTypeId = NodeTypes.StoredProcedure; + OnInitialize(); + } + } + + internal sealed partial class TableValuedFunctionTreeNode : SmoTreeNode + { + public TableValuedFunctionTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "TableValuedFunction"; + this.NodeTypeId = NodeTypes.TableValuedFunction; + OnInitialize(); + } + } + + internal sealed partial class ScalarValuedFunctionTreeNode : SmoTreeNode + { + public ScalarValuedFunctionTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "ScalarValuedFunction"; + this.NodeTypeId = NodeTypes.ScalarValuedFunction; + OnInitialize(); + } + } + + internal sealed partial class AggregateFunctionTreeNode : SmoTreeNode + { + public AggregateFunctionTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "AggregateFunction"; + this.NodeTypeId = NodeTypes.AggregateFunction; + OnInitialize(); + } + } + + internal sealed partial class FileGroupTreeNode : SmoTreeNode + { + public FileGroupTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "FileGroup"; + this.NodeTypeId = NodeTypes.FileGroup; + OnInitialize(); + } + } + + internal sealed partial class ExternalTableTreeNode : SmoTreeNode + { + public ExternalTableTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "ExternalTable"; + this.NodeTypeId = NodeTypes.ExternalTable; + OnInitialize(); + } + } + + internal sealed partial class ExternalResourceTreeNode : SmoTreeNode + { + public ExternalResourceTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "ExternalResource"; + this.NodeTypeId = NodeTypes.ExternalResource; + OnInitialize(); + } + } + + internal sealed partial class HistoryTableTreeNode : SmoTreeNode + { + public HistoryTableTreeNode() : base() + { + NodeValue = string.Empty; + this.NodeType = "HistoryTable"; + this.NodeTypeId = NodeTypes.HistoryTable; + OnInitialize(); + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Server" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Databases, + NodeType = "Folder", + NodeTypeId = NodeTypes.Databases, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Security, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelSecurity, + IsSystemObject = false, + ValidFor = ValidForFlag.All, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ServerObjects, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelServerObjects, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class DatabasesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Databases" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 0 }, + }); + return filters; + } + } + + public override IEnumerable SmoProperties + { + get + { + var properties = new List(); + properties.Add(new NodeSmoProperty + { + Name = "Status", + ValidFor = ValidForFlag.All + }); + return properties; + } + } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemDatabases, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemDatabases, + IsSystemObject = true, + ValidFor = ValidForFlag.All, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDatabaseQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new DatabaseTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelSecurityChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelSecurity" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_LinkedServerLogins, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelLinkedServerLogins, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Logins, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelLogins, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ServerRoles, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelServerRoles, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Credentials, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelCredentials, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_CryptographicProviders, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelCryptographicProviders, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ServerAudits, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelServerAudits, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ServerAuditSpecifications, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelServerAuditSpecifications, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelServerObjectsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerObjects" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Endpoints, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelEndpoints, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_LinkedServers, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelLinkedServers, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ServerTriggers, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelServerTriggers, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ErrorMessages, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServerLevelErrorMessages, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemDatabasesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemDatabases" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 1 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDatabaseQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new DatabaseTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelLinkedServerLoginsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelLinkedServerLogins" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlLinkedServerLoginQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelLinkedServerLogin"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelLoginsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelLogins" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlLoginQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelLogin"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelServerRolesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerRoles" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlServerRoleQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelServerRole"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelCredentialsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelCredentials" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlCredentialQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelCredential"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelCryptographicProvidersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelCryptographicProviders" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlCryptographicProviderQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelCryptographicProvider"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelServerAuditsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerAudits" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlServerAuditQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelServerAudit"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelServerAuditSpecificationsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerAuditSpecifications" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlServerAuditSpecificationQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelServerAuditSpecification"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelEndpointsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelEndpoints" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlEndpointQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelEndpoint"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelLinkedServersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelLinkedServers" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlLinkedServerQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelLinkedServer"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelServerTriggersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelServerTriggers" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlServerDdlTriggerQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelServerTrigger"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServerLevelErrorMessagesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServerLevelErrorMessages" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlErrorMessageQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ServerLevelErrorMessage"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class DatabaseChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Database" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Tables, + NodeType = "Folder", + NodeTypeId = NodeTypes.Tables, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Views, + NodeType = "Folder", + NodeTypeId = NodeTypes.Views, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Synonyms, + NodeType = "Folder", + NodeTypeId = NodeTypes.Synonyms, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Programmability, + NodeType = "Folder", + NodeTypeId = NodeTypes.Programmability, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ExternalResources, + NodeType = "Folder", + NodeTypeId = NodeTypes.ExternalResources, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ServiceBroker, + NodeType = "Folder", + NodeTypeId = NodeTypes.ServiceBroker, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Storage, + NodeType = "Folder", + NodeTypeId = NodeTypes.Storage, + IsSystemObject = false, + ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Security, + NodeType = "Folder", + NodeTypeId = NodeTypes.Security, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Database"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class TablesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Tables" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 0 }, + }); + filters.Add(new NodeFilter + { + Property = "TemporalType", + Type = typeof(Enum), + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + Values = new List + { + { TableTemporalType.None }, + { TableTemporalType.SystemVersioned } + } + }); + return filters; + } + } + + public override IEnumerable SmoProperties + { + get + { + var properties = new List(); + properties.Add(new NodeSmoProperty + { + Name = "IsFileTable", + ValidFor = ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017 + }); + properties.Add(new NodeSmoProperty + { + Name = "IsSystemVersioned", + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12 + }); + properties.Add(new NodeSmoProperty + { + Name = "TemporalType", + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12 + }); + properties.Add(new NodeSmoProperty + { + Name = "IsExternal", + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12 + }); + return properties; + } + } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemTables, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemTables, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlTableQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new TableTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ViewsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Views" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 0 }, + }); + return filters; + } + } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemViews, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemViews, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlViewQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new ViewTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SynonymsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Synonyms" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSynonymQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Synonym"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ProgrammabilityChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Programmability" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_StoredProcedures, + NodeType = "Folder", + NodeTypeId = NodeTypes.StoredProcedures, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Functions, + NodeType = "Folder", + NodeTypeId = NodeTypes.Functions, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_DatabaseTriggers, + NodeType = "Folder", + NodeTypeId = NodeTypes.DatabaseTriggers, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Assemblies, + NodeType = "Folder", + NodeTypeId = NodeTypes.Assemblies, + IsSystemObject = false, + ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Types, + NodeType = "Folder", + NodeTypeId = NodeTypes.Types, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Sequences, + NodeType = "Folder", + NodeTypeId = NodeTypes.Sequences, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ExternalResourcesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ExternalResources" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ExternalDataSources, + NodeType = "Folder", + NodeTypeId = NodeTypes.ExternalDataSources, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ExternalFileFormats, + NodeType = "Folder", + NodeTypeId = NodeTypes.ExternalFileFormats, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServiceBrokerChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ServiceBroker" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_MessageTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.MessageTypes, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Contracts, + NodeType = "Folder", + NodeTypeId = NodeTypes.Contracts, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Queues, + NodeType = "Folder", + NodeTypeId = NodeTypes.Queues, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Services, + NodeType = "Folder", + NodeTypeId = NodeTypes.Services, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_RemoteServiceBindings, + NodeType = "Folder", + NodeTypeId = NodeTypes.RemoteServiceBindings, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_BrokerPriorities, + NodeType = "Folder", + NodeTypeId = NodeTypes.BrokerPriorities, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class StorageChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Storage" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_FileGroups, + NodeType = "Folder", + NodeTypeId = NodeTypes.FileGroups, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_FullTextCatalogs, + NodeType = "Folder", + NodeTypeId = NodeTypes.FullTextCatalogs, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_FullTextStopLists, + NodeType = "Folder", + NodeTypeId = NodeTypes.FullTextStopLists, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_LogFiles, + NodeType = "Folder", + NodeTypeId = NodeTypes.SqlLogFiles, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_PartitionFunctions, + NodeType = "Folder", + NodeTypeId = NodeTypes.PartitionFunctions, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_PartitionSchemes, + NodeType = "Folder", + NodeTypeId = NodeTypes.PartitionSchemes, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SearchPropertyLists, + NodeType = "Folder", + NodeTypeId = NodeTypes.SearchPropertyLists, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SecurityChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Security" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Users, + NodeType = "Folder", + NodeTypeId = NodeTypes.Users, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Roles, + NodeType = "Folder", + NodeTypeId = NodeTypes.Roles, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Schemas, + NodeType = "Folder", + NodeTypeId = NodeTypes.Schemas, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_AsymmetricKeys, + NodeType = "Folder", + NodeTypeId = NodeTypes.AsymmetricKeys, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Certificates, + NodeType = "Folder", + NodeTypeId = NodeTypes.Certificates, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SymmetricKeys, + NodeType = "Folder", + NodeTypeId = NodeTypes.SymmetricKeys, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_DatabaseScopedCredentials, + NodeType = "Folder", + NodeTypeId = NodeTypes.DatabaseScopedCredentials, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_DatabaseEncryptionKeys, + NodeType = "Folder", + NodeTypeId = NodeTypes.DatabaseEncryptionKeys, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_MasterKeys, + NodeType = "Folder", + NodeTypeId = NodeTypes.MasterKeys, + IsSystemObject = false, + ValidFor = ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_DatabaseAuditSpecifications, + NodeType = "Folder", + NodeTypeId = NodeTypes.DatabaseAuditSpecifications, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SecurityPolicies, + NodeType = "Folder", + NodeTypeId = NodeTypes.SecurityPolicies, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_AlwaysEncryptedKeys, + NodeType = "Folder", + NodeTypeId = NodeTypes.AlwaysEncryptedKeys, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemTablesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemTables" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 1 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlTableQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new TableTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class TableChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Table" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "TemporalType", + Type = typeof(Enum), + TypeToReverse = typeof(SqlHistoryTableQuerier), + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + Values = new List + { + { TableTemporalType.HistoryTable } + } + }); + return filters; + } + } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Columns, + NodeType = "Folder", + NodeTypeId = NodeTypes.Columns, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Keys, + NodeType = "Folder", + NodeTypeId = NodeTypes.Keys, + IsSystemObject = false, + ValidFor = ValidForFlag.NotSqlDw, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Constraints, + NodeType = "Folder", + NodeTypeId = NodeTypes.Constraints, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Triggers, + NodeType = "Folder", + NodeTypeId = NodeTypes.Triggers, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Indexes, + NodeType = "Folder", + NodeTypeId = NodeTypes.Indexes, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Statistics, + NodeType = "Folder", + NodeTypeId = NodeTypes.Statistics, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlTableQuerier), typeof(SqlHistoryTableQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new HistoryTableTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class HistoryTableChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "HistoryTable" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Columns, + NodeType = "Folder", + NodeTypeId = NodeTypes.Columns, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Constraints, + NodeType = "Folder", + NodeTypeId = NodeTypes.Constraints, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Indexes, + NodeType = "Folder", + NodeTypeId = NodeTypes.Indexes, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Statistics, + NodeType = "Folder", + NodeTypeId = NodeTypes.Statistics, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Table"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ExternalTableChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ExternalTable" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Columns, + NodeType = "Folder", + NodeTypeId = NodeTypes.Columns, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Statistics, + NodeType = "Folder", + NodeTypeId = NodeTypes.Statistics, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlTableQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Table"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ColumnsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Columns" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlColumnQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Column"; + child.SortPriority = SmoTreeNode.NextSortPriority; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class KeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Keys" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IndexKeyType", + Type = typeof(Enum), + TypeToReverse = typeof(SqlIndexQuerier), + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + Values = new List + { + { IndexKeyType.DriPrimaryKey }, + { IndexKeyType.DriUniqueKey } + } + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlIndexQuerier), typeof(SqlForeignKeyConstraintQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Key"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ConstraintsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Constraints" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDefaultConstraintQuerier), typeof(SqlCheckQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Constraint"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class TriggersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Triggers" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDmlTriggerQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Trigger"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class IndexesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Indexes" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IndexKeyType", + Type = typeof(Enum), + TypeToReverse = typeof(SqlIndexQuerier), + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + Values = new List + { + { IndexKeyType.None }, + { IndexKeyType.DriPrimaryKey }, + { IndexKeyType.DriUniqueKey } + } + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlIndexQuerier), typeof(SqlFullTextIndexQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Index"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class StatisticsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Statistics" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlStatisticQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Statistic"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemViewsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemViews" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 1 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlViewQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new ViewTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ViewChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "View" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Columns, + NodeType = "Folder", + NodeTypeId = NodeTypes.Columns, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Triggers, + NodeType = "Folder", + NodeTypeId = NodeTypes.Triggers, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Indexes, + NodeType = "Folder", + NodeTypeId = NodeTypes.Indexes, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Statistics, + NodeType = "Folder", + NodeTypeId = NodeTypes.Statistics, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "View"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class FunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Functions" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemFunctions, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemFunctions, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_TableValuedFunctions, + NodeType = "Folder", + NodeTypeId = NodeTypes.TableValuedFunctions, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ScalarValuedFunctions, + NodeType = "Folder", + NodeTypeId = NodeTypes.ScalarValuedFunctions, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_AggregateFunctions, + NodeType = "Folder", + NodeTypeId = NodeTypes.AggregateFunctions, + IsSystemObject = false, + ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemFunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemFunctions" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_TableValuedFunctions, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemTableValuedFunctions, + IsSystemObject = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ScalarValuedFunctions, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemScalarValuedFunctions, + IsSystemObject = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new TableValuedFunctionTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class DatabaseTriggersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "DatabaseTriggers" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDatabaseDdlTriggerQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "DatabaseTrigger"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class AssembliesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Assemblies" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlAssemblyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Assembly"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class TypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Types" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemDataTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemDataTypes, + IsSystemObject = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_UserDefinedDataTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.UserDefinedDataTypes, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_UserDefinedTableTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.UserDefinedTableTypes, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_UserDefinedTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.UserDefinedTypes, + IsSystemObject = false, + ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_XMLSchemaCollections, + NodeType = "Folder", + NodeTypeId = NodeTypes.XmlSchemaCollections, + IsSystemObject = false, + ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SequencesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Sequences" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSequenceQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Sequence"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemDataTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemDataTypes" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemExactNumerics, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemExactNumerics, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemApproximateNumerics, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemApproximateNumerics, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemDateAndTime, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemDateAndTimes, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemCharacterStrings, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemCharacterStrings, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemUnicodeCharacterStrings, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemUnicodeCharacterStrings, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemBinaryStrings, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemBinaryStrings, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemOtherDataTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemOtherDataTypes, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemCLRDataTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemClrDataTypes, + IsSystemObject = false, + ValidFor = ValidForFlag.All, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemSpatialDataTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemSpatialDataTypes, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UserDefinedDataTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "UserDefinedDataTypes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedDataTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "UserDefinedDataType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UserDefinedTableTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedTableTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new UserDefinedTableTypeTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UserDefinedTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTypes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "UserDefinedType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class XmlSchemaCollectionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "XmlSchemaCollections" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlXmlSchemaCollectionQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "XmlSchemaCollection"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UserDefinedTableTypeChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableType" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Columns, + NodeType = "Folder", + NodeTypeId = NodeTypes.UserDefinedTableTypeColumns, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Keys, + NodeType = "Folder", + NodeTypeId = NodeTypes.UserDefinedTableTypeKeys, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Constraints, + NodeType = "Folder", + NodeTypeId = NodeTypes.UserDefinedTableTypeConstraints, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "UserDefinedTableType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UserDefinedTableTypeColumnsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypeColumns" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlColumnQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "UserDefinedTableTypeColumn"; + child.SortPriority = SmoTreeNode.NextSortPriority; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UserDefinedTableTypeKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypeKeys" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IndexKeyType", + Type = typeof(Enum), + TypeToReverse = typeof(SqlIndexQuerier), + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + Values = new List + { + { IndexKeyType.DriPrimaryKey }, + { IndexKeyType.DriUniqueKey } + } + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlIndexQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "UserDefinedTableTypeKey"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UserDefinedTableTypeConstraintsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "UserDefinedTableTypeConstraints" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDefaultConstraintQuerier), typeof(SqlCheckQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "UserDefinedTableTypeConstraint"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemExactNumericsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemExactNumerics" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemExactNumeric"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemApproximateNumericsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemApproximateNumerics" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemApproximateNumeric"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemDateAndTimesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemDateAndTimes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemDateAndTime"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemCharacterStringsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemCharacterStrings" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemCharacterString"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemUnicodeCharacterStringsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemUnicodeCharacterStrings" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemUnicodeCharacterString"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemBinaryStringsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemBinaryStrings" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemBinaryString"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemOtherDataTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemOtherDataTypes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemOtherDataType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemClrDataTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemClrDataTypes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemClrDataType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemSpatialDataTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemSpatialDataTypes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBuiltInTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemSpatialDataType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ExternalDataSourcesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ExternalDataSources" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlExternalDataSourceQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ExternalDataSource"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ExternalFileFormatsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ExternalFileFormats" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlExternalFileFormatQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ExternalFileFormat"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class StoredProceduresChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "StoredProcedures" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 0 }, + }); + return filters; + } + } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemStoredProcedures, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemStoredProcedures, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlProcedureQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new StoredProcedureTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemStoredProceduresChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemStoredProcedures" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 1 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlProcedureQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new StoredProcedureTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class StoredProcedureChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "StoredProcedure" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Parameters, + NodeType = "Folder", + NodeTypeId = NodeTypes.StoredProcedureParameters, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "StoredProcedure"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class StoredProcedureParametersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "StoredProcedureParameters" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSubroutineParameterQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "StoredProcedureParameter"; + child.SortPriority = SmoTreeNode.NextSortPriority; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class TableValuedFunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "TableValuedFunctions" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "FunctionType", + Type = typeof(Enum), + Values = new List + { + { UserDefinedFunctionType.Table } + } + }); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 0 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedFunctionQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new TableValuedFunctionTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemTableValuedFunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemTableValuedFunctions" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "FunctionType", + Type = typeof(Enum), + Values = new List + { + { UserDefinedFunctionType.Table } + } + }); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 1 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedFunctionQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new TableValuedFunctionTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class TableValuedFunctionChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "TableValuedFunction" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Parameters, + NodeType = "Folder", + NodeTypeId = NodeTypes.TableValuedFunctionParameters, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "TableValuedFunction"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class TableValuedFunctionParametersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "TableValuedFunctionParameters" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSubroutineParameterQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "TableValuedFunctionParameter"; + child.SortPriority = SmoTreeNode.NextSortPriority; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ScalarValuedFunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ScalarValuedFunctions" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "FunctionType", + Type = typeof(Enum), + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + Values = new List + { + { UserDefinedFunctionType.Scalar } + } + }); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 0 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedFunctionQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new ScalarValuedFunctionTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemScalarValuedFunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemScalarValuedFunctions" }; } + + public override IEnumerable Filters + { + get + { + var filters = new List(); + filters.Add(new NodeFilter + { + Property = "FunctionType", + Type = typeof(Enum), + Values = new List + { + { UserDefinedFunctionType.Scalar } + } + }); + filters.Add(new NodeFilter + { + Property = "IsSystemObject", + Type = typeof(bool), + Values = new List { 1 }, + }); + return filters; + } + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedFunctionQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new ScalarValuedFunctionTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ScalarValuedFunctionChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ScalarValuedFunction" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Parameters, + NodeType = "Folder", + NodeTypeId = NodeTypes.ScalarValuedFunctionParameters, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ScalarValuedFunction"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ScalarValuedFunctionParametersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ScalarValuedFunctionParameters" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSubroutineParameterQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ScalarValuedFunctionParameter"; + child.SortPriority = SmoTreeNode.NextSortPriority; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class AggregateFunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "AggregateFunctions" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserDefinedAggregateQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new AggregateFunctionTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class AggregateFunctionChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "AggregateFunction" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_Parameters, + NodeType = "Folder", + NodeTypeId = NodeTypes.AggregateFunctionParameters, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new Type[0]; } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "AggregateFunction"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class AggregateFunctionParametersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "AggregateFunctionParameters" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSubroutineParameterQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "AggregateFunctionParameter"; + child.SortPriority = SmoTreeNode.NextSortPriority; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class RemoteServiceBindingsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "RemoteServiceBindings" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlRemoteServiceBindingQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "RemoteServiceBinding"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class BrokerPrioritiesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "BrokerPriorities" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlBrokerPriorityQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "BrokerPriority"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class FileGroupsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "FileGroups" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlFileGroupQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new FileGroupTreeNode(); + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class FullTextCatalogsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "FullTextCatalogs" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlFullTextCatalogQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "FullTextCatalog"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class FullTextStopListsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "FullTextStopLists" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlFullTextStopListQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "FullTextStopList"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SqlLogFilesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SqlLogFiles" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlFileQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SqlLogFile"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class PartitionFunctionsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "PartitionFunctions" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlPartitionFunctionQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "PartitionFunction"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class PartitionSchemesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "PartitionSchemes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlPartitionSchemeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "PartitionScheme"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SearchPropertyListsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SearchPropertyLists" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSearchPropertyListQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SearchPropertyList"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class FileGroupChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "FileGroup" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_FilegroupFiles, + NodeType = "Folder", + NodeTypeId = NodeTypes.FileGroupFiles, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class FileGroupFilesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "FileGroupFiles" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlFileQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "FileGroupFile"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class UsersChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Users" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlUserQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "User"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class RolesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Roles" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_DatabaseRoles, + NodeType = "Folder", + NodeTypeId = NodeTypes.DatabaseRoles, + IsSystemObject = false, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ApplicationRoles, + NodeType = "Folder", + NodeTypeId = NodeTypes.ApplicationRoles, + IsSystemObject = false, + ValidFor = ValidForFlag.AzureV12|ValidForFlag.AllOnPrem, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SchemasChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Schemas" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSchemaQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Schema"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class AsymmetricKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "AsymmetricKeys" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlAsymmetricKeyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "AsymmetricKey"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class CertificatesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Certificates" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlCertificateQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Certificate"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SymmetricKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SymmetricKeys" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSymmetricKeyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SymmetricKey"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class DatabaseEncryptionKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "DatabaseEncryptionKeys" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDatabaseEncryptionKeyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "DatabaseEncryptionKey"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class MasterKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "MasterKeys" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlMasterKeyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "MasterKey"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class DatabaseAuditSpecificationsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "DatabaseAuditSpecifications" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDatabaseAuditSpecificationQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "DatabaseAuditSpecification"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SecurityPoliciesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SecurityPolicies" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlSecurityPolicyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SecurityPolicie"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class DatabaseScopedCredentialsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "DatabaseScopedCredentials" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlDatabaseCredentialQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "DatabaseScopedCredential"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class AlwaysEncryptedKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "AlwaysEncryptedKeys" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ColumnMasterKeys, + NodeType = "Folder", + NodeTypeId = NodeTypes.ColumnMasterKeys, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_ColumnEncryptionKeys, + NodeType = "Folder", + NodeTypeId = NodeTypes.ColumnEncryptionKeys, + IsSystemObject = false, + ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes { get {return null;} } + + + public override TreeNode CreateChild(TreeNode parent, object context) + { + return null; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class DatabaseRolesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "DatabaseRoles" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlRoleQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "DatabaseRole"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ApplicationRolesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ApplicationRoles" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlApplicationRoleQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ApplicationRole"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ColumnMasterKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ColumnMasterKeys" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlColumnMasterKeyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ColumnMasterKey"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ColumnEncryptionKeysChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "ColumnEncryptionKeys" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlColumnEncryptionKeyQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "ColumnEncryptionKey"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class MessageTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "MessageTypes" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemMessageTypes, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemMessageTypes, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlMessageTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "MessageType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemMessageTypesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemMessageTypes" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlMessageTypeQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemMessageType"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ContractsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Contracts" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemContracts, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemContracts, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlContractQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Contract"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemContractsChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemContracts" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlContractQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemContract"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class QueuesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Queues" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemQueues, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemQueues, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlQueueQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Queue"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemQueuesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemQueues" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlQueueQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemQueue"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class ServicesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "Services" }; } + + protected override void OnExpandPopulateFolders(IList currentChildren, TreeNode parent) + { + currentChildren.Add(new FolderNode { + NodeValue = SR.SchemaHierarchy_SystemServices, + NodeType = "Folder", + NodeTypeId = NodeTypes.SystemServices, + IsSystemObject = true, + IsMsShippedOwned = true, + SortPriority = SmoTreeNode.NextSortPriority, + }); + } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlServiceQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "Service"; + InitializeChild(parent, child, context); + return child; + } + } + + [Export(typeof(ChildFactory))] + [Shared] + internal partial class SystemServicesChildFactory : SmoChildFactoryBase + { + public override IEnumerable ApplicableParents() { return new[] { "SystemServices" }; } + + internal override Type[] ChildQuerierTypes + { + get + { + return new [] { typeof(SqlServiceQuerier), }; + } + } + + public override TreeNode CreateChild(TreeNode parent, object context) + { + var child = new SmoTreeNode(); + child.IsAlwaysLeaf = true; + child.NodeType = "SystemService"; + InitializeChild(parent, child, context); + return child; + } + } + +} + diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SqlServerType.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SqlServerType.cs index 5b4fc395..f7e0cbc2 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SqlServerType.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SqlServerType.cs @@ -45,7 +45,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer /// public static bool IsValidFor(ValidForFlag serverVersion, ValidForFlag validFor) { - return validFor == ValidForFlag.None || validFor.HasFlag(serverVersion); + // If either the flag is not set or if the serverVersion has a default value of "all", allow the check + // Otherwise, actually do the comparison of the flags + return validFor == ValidForFlag.None || serverVersion == ValidForFlag.All || validFor.HasFlag(serverVersion); } /// @@ -108,6 +110,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer { serverType = SqlServerType.Sql2017; } + else + { + // vNext case - default to latest version + serverType = SqlServerType.Sql2017; + } } return serverType;