mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-18 09:35:38 -05:00
Fix for srGen designer issues (#321)
* removing designer files * adding designer files to gitignore * updating refs and tests
This commit is contained in:
@@ -7,12 +7,12 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlTools.ServiceLayer.Metadata.Contracts;
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlTools.ServiceLayer.Metadata.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
{
|
||||
/// <summary>
|
||||
@@ -25,7 +25,6 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
private TreeNode parent;
|
||||
private string nodePath;
|
||||
private string label;
|
||||
private ObjectExplorerService objectExplorerService;
|
||||
public const char PathPartSeperator = '/';
|
||||
|
||||
/// <summary>
|
||||
@@ -53,8 +52,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
public string NodeValue { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Object metadata for smo objects
|
||||
/// <summary>
|
||||
/// Object metadata for smo objects
|
||||
/// </summary>
|
||||
public ObjectMetadata ObjectMetadata { get; set; }
|
||||
|
||||
@@ -151,17 +150,17 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
nodePath = path;
|
||||
}
|
||||
|
||||
public TreeNode FindNodeByPath(string path)
|
||||
{
|
||||
TreeNode nodeForPath = ObjectExplorerUtils.FindNode(this, node =>
|
||||
{
|
||||
return node.GetNodePath() == path;
|
||||
}, nodeToFilter =>
|
||||
{
|
||||
return path.StartsWith(nodeToFilter.GetNodePath());
|
||||
});
|
||||
|
||||
return nodeForPath;
|
||||
public TreeNode FindNodeByPath(string path)
|
||||
{
|
||||
TreeNode nodeForPath = ObjectExplorerUtils.FindNode(this, node =>
|
||||
{
|
||||
return node.GetNodePath() == path;
|
||||
}, nodeToFilter =>
|
||||
{
|
||||
return path.StartsWith(nodeToFilter.GetNodePath());
|
||||
});
|
||||
|
||||
return nodeForPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Composition;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Hosting;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Hosting;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -61,8 +61,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
return applicableNodeChildFactories.Value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// As an <see cref="IComposableService"/>, this will be set whenever the service is initialized
|
||||
/// via an <see cref="IMultiServiceProvider"/>
|
||||
@@ -126,18 +126,18 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
await HandleRequestAsync(doCreateSession, context, "HandleCreateSessionRequest");
|
||||
}
|
||||
|
||||
internal async Task<NodeInfo[]> ExpandNode(ObjectExplorerSession session, string nodePath)
|
||||
{
|
||||
return await Task.Factory.StartNew(() =>
|
||||
{
|
||||
NodeInfo[] nodes = null;
|
||||
TreeNode node = session.Root.FindNodeByPath(nodePath);
|
||||
if(node != null)
|
||||
{
|
||||
nodes = node.Expand().Select(x => x.ToNodeInfo()).ToArray();
|
||||
}
|
||||
return nodes;
|
||||
});
|
||||
internal async Task<NodeInfo[]> ExpandNode(ObjectExplorerSession session, string nodePath)
|
||||
{
|
||||
return await Task.Factory.StartNew(() =>
|
||||
{
|
||||
NodeInfo[] nodes = null;
|
||||
TreeNode node = session.Root.FindNodeByPath(nodePath);
|
||||
if(node != null)
|
||||
{
|
||||
nodes = node.Expand().Select(x => x.ToNodeInfo()).ToArray();
|
||||
}
|
||||
return nodes;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -168,14 +168,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
// open connection based on request details
|
||||
ConnectionCompleteParams result = await connectionService.Connect(connectParams);
|
||||
if(result != null && !string.IsNullOrEmpty(result.ConnectionId))
|
||||
{
|
||||
return result;
|
||||
if(result != null && !string.IsNullOrEmpty(result.ConnectionId))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result);
|
||||
return null;
|
||||
else
|
||||
{
|
||||
await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -202,13 +202,13 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
string uri = expandParams.SessionId;
|
||||
ObjectExplorerSession session = null;
|
||||
NodeInfo[] nodes = null;
|
||||
if (sessionMap.ContainsKey(uri))
|
||||
{
|
||||
session = sessionMap[uri];
|
||||
if (sessionMap.ContainsKey(uri))
|
||||
{
|
||||
session = sessionMap[uri];
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: error
|
||||
else
|
||||
{
|
||||
//TODO: error
|
||||
}
|
||||
|
||||
|
||||
@@ -303,11 +303,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
if (serviceProvider == null)
|
||||
{
|
||||
throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet);
|
||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
||||
}
|
||||
if (connectionService == null)
|
||||
{
|
||||
throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet);
|
||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
childFactories[parent] = applicableFactories;
|
||||
}
|
||||
applicableFactories.Add(factory);
|
||||
}
|
||||
}
|
||||
|
||||
internal class ObjectExplorerSession
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
@@ -73,13 +73,13 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
if (ServiceProvider == null)
|
||||
{
|
||||
throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet);
|
||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
||||
}
|
||||
ObjectExplorerService service = ServiceProvider.GetService<ObjectExplorerService>();
|
||||
if (service == null)
|
||||
{
|
||||
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,
|
||||
SqlTools.Hosting.Localization.sr.ServiceNotFound, nameof(ObjectExplorerService)));
|
||||
SqlTools.Hosting.SR.ServiceNotFound, nameof(ObjectExplorerService)));
|
||||
}
|
||||
|
||||
return service;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// This file was generated by a T4 Template. Do not modify directly, instead update the SmoQueryModelDefinition.xml file
|
||||
// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool",
|
||||
// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen".
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Linq;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlServer.Management.Smo.Broker;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
// This file was generated by a T4 Template. Do not modify directly, instead update the SmoQueryModelDefinition.xml file
|
||||
// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool",
|
||||
// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen".
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Linq;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlServer.Management.Smo.Broker;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
|
||||
[Export(typeof(SmoQuerier))]
|
||||
internal partial class SqlDatabaseQuerier: SmoQuerier
|
||||
@@ -1569,5 +1569,5 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
return Enumerable.Empty<SqlSmoObject>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using Microsoft.SqlTools.ServiceLayer;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using Microsoft.SqlTools.ServiceLayer;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
|
||||
internal sealed partial class DatabaseInstanceTreeNode : SmoTreeNode
|
||||
{
|
||||
public DatabaseInstanceTreeNode() : base()
|
||||
@@ -3452,5 +3452,5 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user