diff --git a/src/AddIns/Misc/SharpServerTools/OracleDbToolsProvider/Src/Forms/OracleFormsArtefactFactory.cs b/src/AddIns/Misc/SharpServerTools/OracleDbToolsProvider/Src/Forms/OracleFormsArtefactFactory.cs
index 52d15ba04c..4e5516882c 100644
--- a/src/AddIns/Misc/SharpServerTools/OracleDbToolsProvider/Src/Forms/OracleFormsArtefactFactory.cs
+++ b/src/AddIns/Misc/SharpServerTools/OracleDbToolsProvider/Src/Forms/OracleFormsArtefactFactory.cs
@@ -32,7 +32,7 @@ namespace SharpDbTools.Oracle.Forms
+ ": creating MetaDataNode for: " + logicalConnectionName);
// create root node of the metadata collections tree
- string nodeName = ResourceService.GetString("SharpDbTools.Data.DbObjectNodeName");
+ string nodeName = ResourceService.GetString("SharpDbTools.Forms.DbObjectNodeName");
TreeNode metaNode = new TreeNode(nodeName);
// retrieve the metadata for this logical connection name
diff --git a/src/AddIns/Misc/SharpServerTools/SQLServerDbToolsProvider/Src/Forms/SQLServerFormsArtefactFactory.cs b/src/AddIns/Misc/SharpServerTools/SQLServerDbToolsProvider/Src/Forms/SQLServerFormsArtefactFactory.cs
index abc97f2aa3..f93beae054 100644
--- a/src/AddIns/Misc/SharpServerTools/SQLServerDbToolsProvider/Src/Forms/SQLServerFormsArtefactFactory.cs
+++ b/src/AddIns/Misc/SharpServerTools/SQLServerDbToolsProvider/Src/Forms/SQLServerFormsArtefactFactory.cs
@@ -16,9 +16,13 @@ using SharpDbTools.Forms;
namespace SharpDbTools.SQLServer.Forms
{
///
- /// Description of MetaDataNodeBuilder.
- /// TODO: currently this is just a flat list - need to reflect ownership
- /// relationships such as schema etc
+ /// Creates a TreeNode that displays the metadata for a SQLServer database
+ /// Uses:
+ /// - DbModelInfo and DbModelInfoService: to access the metadata
+ /// - TableTreeNode: to display Table metadata - this has 'Describe'
+ /// behaviour associated with it, accessed via a right mouse menu
+ /// Going forward this should reflect the structure and relationship
+ /// of SQLServer objects - for now it is generic
///
public class SQLServerFormsArtefactFactory : FormsArtefactFactory
{
@@ -32,7 +36,8 @@ namespace SharpDbTools.SQLServer.Forms
+ ": creating MetaDataNode for: " + logicalConnectionName);
// create root node of the metadata collections tree
- TreeNode metaNode = new TreeNode("Db Objects");
+ string nodeName = ResourceService.GetString("SharpDbTools.Forms.DbObjectNodeName");
+ TreeNode metaNode = new TreeNode(nodeName);
// retrieve the metadata for this logical connection name
@@ -52,7 +57,9 @@ namespace SharpDbTools.SQLServer.Forms
LoggingService.Debug("looking for metadata: " + metadataCollectionName);
DataTable metaCollectionTable = info.Tables[metadataCollectionName];
LoggingService.Debug("found metadata collection: " + metadataCollectionName);
- TreeNode collectionNode = new TreeNode(metadataCollectionName);
+ string nodeDisplayNameKey = "SharpDbTools.Data.PrimaryObjects." + metadataCollectionName;
+ string nodeDisplayName = ResourceService.GetString(nodeDisplayNameKey);
+ TreeNode collectionNode = new TreeNode(nodeDisplayName);
metaNode.Nodes.Add(collectionNode);
if (metaCollectionTable != null) {
diff --git a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Resources/Strings.resx b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Resources/Strings.resx
index 7b49f110d2..aa4fa3cc74 100644
--- a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Resources/Strings.resx
+++ b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Resources/Strings.resx
@@ -133,7 +133,73 @@
Users
-
+
Db Objects
+
+ Database Explorer
+
+
+ Add Connection
+
+
+ Delete Connection
+
+
+ Save All
+
+
+ Connection Properties
+
+
+ No Metadata
+
+
+ Set Connection String
+
+
+ Load Metadata From Connection
+
+
+ Load Metadata From File
+
+
+ Open SQL Tool
+
+
+ Connection String:
+
+
+ Invariant Name:
+
+
+ Connection Succeeded
+
+
+ Connection Failed
+
+
+ Test
+
+
+ Submit
+
+
+ Cancel
+
+
+ Data Source Type:
+
+
+ Connection String:
+
+
+ Connection String
+
+
+ Test Result Message
+
+
+ Set Up Connection String
+
\ No newline at end of file
diff --git a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/ConnectionStringDefinitionDialog.cs b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/ConnectionStringDefinitionDialog.cs
index a3237f7056..2832c55a57 100644
--- a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/ConnectionStringDefinitionDialog.cs
+++ b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/ConnectionStringDefinitionDialog.cs
@@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data.Common;
using System.Windows.Forms;
+using ICSharpCode.Core;
using SharpDbTools.Data;
@@ -40,6 +41,19 @@ namespace SharpDbTools.Forms
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
+
+ // overwrite Text properties using ResourceService
+
+ this.testButton.Text = ResourceService.GetString("SharpDbTools.Forms.TestButton");
+ this.submitButton.Text = ResourceService.GetString("SharpDbTools.Forms.SubmitButton");
+ this.cancelButton.Text = ResourceService.GetString("SharpDbTools.Forms.CancelButton");
+ this.dataSourceTypeLabel.Text = ResourceService.GetString("SharpDbTools.Forms.DataSourceTypeLabel");
+ this.connectionStringLabel.Text = ResourceService.GetString("SharpDbTools.Forms.ConnectionStringLabel");
+ this.connectionStringTab.Text = ResourceService.GetString("SharpDbTools.Forms.ConnectionStringTab");
+ this.testResultTab.Text = ResourceService.GetString("SharpDbTools.Forms.TestResultTab");
+ this.Text = ResourceService.GetString("SharpDbTools.Forms.ConnectionStringDefinitionDialog");
+
+
this.connStringPropertyGrid.PropertyValueChanged +=
new PropertyValueChangedEventHandler(this.ConnStringAttributesViewPropertyValueChanged);
// add a ProgressBar to the statusString
@@ -187,12 +201,13 @@ namespace SharpDbTools.Forms
connection.ConnectionString = this.ConnectionString;
connection.Open();
- e.Result = "Connection Succeeded";
+ e.Result = ResourceService.GetString("SharpDbTools.Forms.ConnectionSucceededMsg"); //"Connection Succeeded";
connectionTestState = ConnectionTestState.TestSucceeded;
}
catch(Exception ex)
{
- e.Result = "Connection Failed: " + ex.Message;
+ e.Result =
+ ResourceService.GetString("SharpDbTools.Forms.ConnectionFailedMsg") + ex.Message; /*"Connection Failed: "*/
connectionTestState = ConnectionTestState.TestFailed;
}
finally
diff --git a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DatabaseExplorerTreeNode.cs b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DatabaseExplorerTreeNode.cs
index 0a6f2efcce..47c0af6f72 100644
--- a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DatabaseExplorerTreeNode.cs
+++ b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DatabaseExplorerTreeNode.cs
@@ -23,20 +23,32 @@ namespace SharpDbTools.Forms
/// Hold minimal state - access state through the DbModelInfoService
///
public class DatabaseExplorerTreeNode: TreeNode, IRebuildable, IRequiresRebuildSource, ISupportsDragDrop
- {
- public DatabaseExplorerTreeNode(): base("Database Explorer")
+ {
+ static DatabaseExplorerTreeNode()
{
+ ResourceService.RegisterStrings("SharpDbTools.Resources.Strings", typeof(DatabaseExplorerTreeNode).Assembly);
+ }
+
+ public DatabaseExplorerTreeNode(): base()
+ {
+ this.Text = ResourceService.GetString("SharpDbTools.Forms.DbExplorerNodeName");
ContextMenuStrip cMenu = new ContextMenuStrip();
ToolStripMenuItem addConnectionMenuItem =
- new ToolStripMenuItem("Add Connection");
+ new ToolStripMenuItem();
+ addConnectionMenuItem.Text =
+ ResourceService.GetString("SharpDbTools.Forms.AddConnectionMenu");
addConnectionMenuItem.Click += new EventHandler(AddDbConnectionClickHandler);
ToolStripMenuItem deleteConnectionMenuItem =
- new ToolStripMenuItem("Delete Connection");
+ new ToolStripMenuItem();
+ deleteConnectionMenuItem.Text =
+ ResourceService.GetString("SharpDbTools.Forms.DeleteConnectionMenu");
deleteConnectionMenuItem.Click += new EventHandler(DeleteDbConnectionClickHandler);
ToolStripMenuItem saveMetadataMenuItem =
- new ToolStripMenuItem("Save All");
+ new ToolStripMenuItem();
+ saveMetadataMenuItem.Text =
+ ResourceService.GetString("SharpDbTools.Forms.SaveAllMenu");
saveMetadataMenuItem.Click += new EventHandler(SaveDbModelInfoClickHandler);
diff --git a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DbModelInfoTreeNode.cs b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DbModelInfoTreeNode.cs
index e7f2895ddb..3ff03511a5 100644
--- a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DbModelInfoTreeNode.cs
+++ b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DbModelInfoTreeNode.cs
@@ -47,18 +47,22 @@ namespace SharpDbTools.Forms
// create menu items
ToolStripMenuItem setConnectionStringMenuItem =
- new ToolStripMenuItem("Set Connection String");
+ new ToolStripMenuItem();
+ setConnectionStringMenuItem.Text = ResourceService.GetString("SharpDbTools.Forms.SetConnectionStringMenu");
setConnectionStringMenuItem.Click += new EventHandler(SetConnectionStringOnDbModelInfoClickHandler);
ToolStripMenuItem loadMetadataFromConnectionMenuItem =
- new ToolStripMenuItem("Load Metadata from Connection");
+ new ToolStripMenuItem();
+ loadMetadataFromConnectionMenuItem.Text = ResourceService.GetString("SharpDbTools.Forms.LoadMetadataFromConnectionMenu");
loadMetadataFromConnectionMenuItem.Click += new EventHandler(LoadMetadataFromConnectionClickHandler);
ToolStripMenuItem loadMetadataFromFileMenuItem =
- new ToolStripMenuItem("Load Metadata from File");
+ new ToolStripMenuItem();
+ loadMetadataFromFileMenuItem.Text = ResourceService.GetString("SharpDbTools.Forms.LoadMetadataFromFileMenu");
loadMetadataFromFileMenuItem.Click += new EventHandler(LoadMetadataFromFileClickHandler);
- ToolStripMenuItem openSQLToolMenuItem = new ToolStripMenuItem("Open SQL Tool");
+ ToolStripMenuItem openSQLToolMenuItem = new ToolStripMenuItem();
+ openSQLToolMenuItem.Text = ResourceService.GetString("SharpDbTools.Forms.OpenSQLToolMenu");
openSQLToolMenuItem.Click += new EventHandler(OpenSQLToolClickHandler);
cMenu.Items.AddRange(new ToolStripMenuItem[]
@@ -116,14 +120,17 @@ namespace SharpDbTools.Forms
string invariantName = modelInfo.InvariantName;
TreeNode attributesNode = new TreeNode("Connection Properties");
+ attributesNode.Text = ResourceService.GetString("SharpDbTools.Forms.ConnectionPropertiesNodeName");
if (connectionString != null) {
- TreeNode cstringNode = new TreeNode("Connection String: " + connectionString);
+ TreeNode cstringNode = new TreeNode();
+ cstringNode.Text = ResourceService.GetString("SharpDbTools.Forms.ConnectionStringNodeName") + connectionString;
attributesNode.Nodes.Add(cstringNode);
}
if (invariantName != null) {
- TreeNode invNameNode = new TreeNode("Invariant Name: " + invariantName);
+ TreeNode invNameNode = new TreeNode();
+ invNameNode.Text = ResourceService.GetString("SharpDbTools.Forms.InvariantNameNodeName") + invariantName;
attributesNode.Nodes.Add(invNameNode);
}
diff --git a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/FormsArtefactFactory.cs b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/FormsArtefactFactory.cs
index be5be12862..bbd9453d34 100644
--- a/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/FormsArtefactFactory.cs
+++ b/src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/FormsArtefactFactory.cs
@@ -25,11 +25,6 @@ namespace SharpDbTools.Forms
{
}
- static FormsArtefactFactory()
- {
- ResourceService.RegisterStrings("SharpDbTools.Resources.Strings", typeof(FormsArtefactFactory).Assembly);
- }
-
public abstract TreeNode CreateMetaDataNode(string name);
public abstract string[] GetDescribeTableFieldNames();
public abstract string[] GetDescribeTableColumnHeaderNames();