handling offline and inassisable db in oe (#369)

* handling offline and inassisable db in oe
This commit is contained in:
Leila Lali
2017-06-07 12:21:24 -07:00
committed by GitHub
parent 3bf562acf0
commit b60a865706
26 changed files with 371 additions and 199 deletions

View File

@@ -84,6 +84,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
IEnumerable<SmoQuerier> queriers = context.ServiceProvider.GetServices<SmoQuerier>(q => IsCompatibleQuerier(q));
var filters = this.Filters.ToList();
var smoProperties = this.SmoProperties.Where(p => (p.ValidFor == 0 || p.ValidFor.HasFlag(validForFlag))).Select(x => x.Name);
if (!string.IsNullOrEmpty(name))
{
filters.Add(new NodeFilter
@@ -98,7 +99,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
string propertyFilter = GetProperyFilter(filters, querier.GetType(), validForFlag);
try
{
var smoObjectList = querier.Query(context, propertyFilter, refresh).ToList();
var smoObjectList = querier.Query(context, propertyFilter, refresh, smoProperties).ToList();
foreach (var smoObject in smoObjectList)
{
if (smoObject == null)
@@ -239,6 +240,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
}
}
public override IEnumerable<NodeSmoProperty> SmoProperties
{
get
{
return Enumerable.Empty<NodeSmoProperty>();
}
}
/// <summary>
/// Returns true if any final validation of the object to be added passes, and false
/// if validation fails. This provides a chance to filter specific items out of a list