mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 17:23:27 -05:00
improving OE tables expand (#555)
* improving OE tables expand for dw database
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user