mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-15 17:23:32 -05:00
Bug fix for https://github.com/Microsoft/azuredatastudio/issues/2923 and misc other fixes (#711)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||
@@ -14,27 +15,21 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
/// </summary>
|
||||
internal partial class TriggersChildFactory : SmoChildFactoryBase
|
||||
{
|
||||
public static readonly List<NodeSmoProperty> SmoPropertyList = new List<NodeSmoProperty>
|
||||
public static readonly Lazy<List<NodeSmoProperty>> SmoPropertiesLazy = new Lazy<List<NodeSmoProperty>>(() => new List<NodeSmoProperty>
|
||||
{
|
||||
new NodeSmoProperty
|
||||
{
|
||||
Name = "IsEnabled",
|
||||
ValidFor = ValidForFlag.All
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
public override string GetNodeStatus(object smoObject, SmoQueryContext smoContext)
|
||||
{
|
||||
return TriggersCustomeNodeHelper.GetStatus(smoObject);
|
||||
}
|
||||
|
||||
public override IEnumerable<NodeSmoProperty> SmoProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
return TriggersChildFactory.SmoPropertyList;
|
||||
}
|
||||
}
|
||||
public override IEnumerable<NodeSmoProperty> SmoProperties => SmoPropertiesLazy.Value;
|
||||
}
|
||||
|
||||
internal partial class ServerLevelServerTriggersChildFactory : SmoChildFactoryBase
|
||||
@@ -48,7 +43,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return TriggersChildFactory.SmoPropertyList;
|
||||
return TriggersChildFactory.SmoPropertiesLazy.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,7 +59,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return TriggersChildFactory.SmoPropertyList;
|
||||
return TriggersChildFactory.SmoPropertiesLazy.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user