improving OE tables expand (#555)

* improving OE tables expand for dw database
This commit is contained in:
Leila Lali
2017-12-01 14:49:42 -08:00
committed by GitHub
parent ab332cba9b
commit 1ec297efe2
11 changed files with 84 additions and 43 deletions

View File

@@ -45,12 +45,12 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
/// <summary>
/// Returns the node sub type if the object can have sub types otehr wise returns empty string
/// </summary>
public abstract string GetNodeSubType(object context);
public abstract string GetNodeSubType(object smoObject, SmoQueryContext smoContext);
/// <summary>
/// Returns the status of the object assigned to node. If the object doesn't spport status returns empty string
/// </summary>
public abstract string GetNodeStatus(object context);
public abstract string GetNodeStatus(object smoObject, SmoQueryContext smoContext);
/// <summary>
/// Returns the custom name of the object assigned to the node. If the object doesn't have custom name, returns empty string

View File

@@ -3,6 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -29,6 +30,15 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
get { return numInits.HasValue && numInits != 0; }
}
public bool IsSorted
{
get
{
// SMO objects are already sorted so no need to sort them again
return this.FirstOrDefault() is SmoTreeNode;
}
}
public void BeginInit()
{
if (!numInits.HasValue)
@@ -54,7 +64,10 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
{
try
{
DoSort();
if (!IsSorted)
{
DoSort();
}
if (deferredChildren != null)
{