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

@@ -37,6 +37,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
/// </summary>
public abstract IEnumerable<NodeFilter> Filters { get; }
/// <summary>
/// The list of properties to be loaded with the object
/// </summary>
public abstract IEnumerable<NodeSmoProperty> SmoProperties { get; }
/// <summary>
/// Returns the node sub type if the object can have sub types otehr wise returns empty string
/// </summary>

View File

@@ -0,0 +1,23 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
{
/// <summary>
/// Has information for SMO object properties to be loaded with the SMO object
/// </summary>
public class NodeSmoProperty
{
/// <summary>
/// Property name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Indicates which platforms a filter is valid for
/// </summary>
public ValidForFlag ValidFor { get; set; }
}
}

View File

@@ -286,7 +286,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
return Parent as T;
}
protected void PopulateChildren(bool refresh, string name = null)
protected virtual void PopulateChildren(bool refresh, string name = null)
{
Logger.Write(LogLevel.Verbose, string.Format(CultureInfo.InvariantCulture, "Populating oe node :{0}", this.GetNodePath()));
Debug.Assert(IsAlwaysLeaf == false);
@@ -331,7 +331,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
}
}
}
catch(Exception ex)
catch (Exception ex)
{
string error = string.Format(CultureInfo.InvariantCulture, "Failed populating oe children. error:{0} inner:{1} stacktrace:{2}",
ex.Message, ex.InnerException != null ? ex.InnerException.Message : "", ex.StackTrace);