Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3326 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
33 changed files with 149 additions and 2031 deletions
|
Before Width: | Height: | Size: 530 B |
@ -1,102 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 15:58 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.ComponentModel; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of ColumnNode.
|
|
||||||
/// </summary>
|
|
||||||
public class ColumnNode: TreeViewItem |
|
||||||
{ |
|
||||||
private string _name; |
|
||||||
private string _type; |
|
||||||
private string _length; |
|
||||||
private string _nullable; |
|
||||||
private string _precision; |
|
||||||
private string _scale; |
|
||||||
|
|
||||||
public ColumnNode() { |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
public ColumnNode(string name, |
|
||||||
string type, |
|
||||||
string length, |
|
||||||
string nullable, |
|
||||||
string precision, |
|
||||||
string scale) |
|
||||||
{ |
|
||||||
_name = name; |
|
||||||
_type = type; |
|
||||||
_length = length; |
|
||||||
_nullable = nullable; |
|
||||||
_precision = precision; |
|
||||||
_scale = scale; |
|
||||||
} |
|
||||||
|
|
||||||
[Browsable(true)] |
|
||||||
public string FieldName { |
|
||||||
get { |
|
||||||
return this._name; |
|
||||||
} |
|
||||||
set { |
|
||||||
this._name = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public string Type { |
|
||||||
get { |
|
||||||
return this._type; |
|
||||||
} |
|
||||||
set { |
|
||||||
this._type = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public string Length { |
|
||||||
get { |
|
||||||
return this._type; |
|
||||||
} |
|
||||||
set { |
|
||||||
this._type = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public string Nullable { |
|
||||||
get { |
|
||||||
return this._nullable; |
|
||||||
} |
|
||||||
set { |
|
||||||
this._nullable = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public string Precision { |
|
||||||
get { |
|
||||||
return this._precision; |
|
||||||
} |
|
||||||
set { |
|
||||||
this._precision = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public string Scale { |
|
||||||
get { |
|
||||||
return this._scale; |
|
||||||
} |
|
||||||
set { |
|
||||||
this._scale = value; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,94 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 15/01/2008 |
|
||||||
* Time: 18:15 |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// View element representing a connection to a db server
|
|
||||||
/// </summary>
|
|
||||||
public class DbConnectionNode : TreeViewItem |
|
||||||
{ |
|
||||||
private TablesNode _tablesNode; |
|
||||||
private ViewsNode _viewsNode; |
|
||||||
private StoreProcsNode _storedProcsNode; |
|
||||||
private FunctionsNode _functionsNode; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Dependent on the state this TreeViewItem should display an
|
|
||||||
/// appropriate icon.
|
|
||||||
/// TODO: select and embed appropriate resources from famfamfam
|
|
||||||
/// </summary>
|
|
||||||
private DbConnectionNodeState state; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name"></param>
|
|
||||||
/// <param name="header"></param>
|
|
||||||
public DbConnectionNode(string header) |
|
||||||
{ |
|
||||||
this.Header = header; |
|
||||||
this.State = DbConnectionNodeState.Closed; |
|
||||||
this._tablesNode = new TablesNode(); |
|
||||||
this._viewsNode = new ViewsNode(); |
|
||||||
this._storedProcsNode = new StoreProcsNode(); |
|
||||||
this._functionsNode = new FunctionsNode(); |
|
||||||
this.Items.Add(_tablesNode); |
|
||||||
this.Items.Add(_viewsNode); |
|
||||||
this.Items.Add(_storedProcsNode); |
|
||||||
this.Items.Add(_functionsNode); |
|
||||||
} |
|
||||||
|
|
||||||
public TablesNode TablesNode { |
|
||||||
get { |
|
||||||
return _tablesNode; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public ViewsNode ViewsNode { |
|
||||||
get { |
|
||||||
return _viewsNode; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public StoreProcsNode StoredProcsNode { |
|
||||||
get { |
|
||||||
return _storedProcsNode; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public FunctionsNode FunctionsNode { |
|
||||||
get { |
|
||||||
return _functionsNode; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public DbConnectionNode(string header, DbConnectionNodeState state): this(header) |
|
||||||
{ |
|
||||||
this.State = state; |
|
||||||
} |
|
||||||
|
|
||||||
public DbConnectionNodeState State { |
|
||||||
get { |
|
||||||
return this.state; |
|
||||||
} |
|
||||||
set { |
|
||||||
this.state = value; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public enum DbConnectionNodeState |
|
||||||
{ |
|
||||||
Open, |
|
||||||
Closed |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,28 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 22/01/2008 |
|
||||||
* Time: 17:53 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Description of DbConnectionsTreeViewItem.
|
|
||||||
/// </summary>
|
|
||||||
public class DbConnectionsNode: TreeViewItem |
|
||||||
{ |
|
||||||
public const string DBCONNECTIONS_NODE_HEADER = "Data Connections"; |
|
||||||
|
|
||||||
public DbConnectionsNode() |
|
||||||
{ |
|
||||||
this.Header = DBCONNECTIONS_NODE_HEADER; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,204 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 15/01/2008 |
|
||||||
* Time: 16:47 |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows; |
|
||||||
using System.Windows.Controls; |
|
||||||
using System.Collections.Generic; |
|
||||||
using System.Data.OleDb; |
|
||||||
using System.Configuration; |
|
||||||
using System.Windows.Threading; |
|
||||||
using MyMeta; |
|
||||||
|
|
||||||
|
|
||||||
using ICSharpCode.DataTools; |
|
||||||
using log=ICSharpCode.Core.LoggingService; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Bridges between the GUI object world and the world of connection strings and db objects
|
|
||||||
/// </summary>
|
|
||||||
public class DbControlController |
|
||||||
{ |
|
||||||
private DbConnectionsNode _dbConnectionsNode; |
|
||||||
|
|
||||||
public DbControlController(DbConnectionsNode dbConnectionsNode) |
|
||||||
{ |
|
||||||
_dbConnectionsNode = dbConnectionsNode; |
|
||||||
} |
|
||||||
/// <summary>
|
|
||||||
/// Creates or refreshes the tree of database objects below the DbConnectionNode
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dbNode"></param>
|
|
||||||
private void UpdateDbConnectionNode(DbConnectionNode dbNode, ConnectionStringSettings s) |
|
||||||
{ |
|
||||||
// update the TablesNode
|
|
||||||
|
|
||||||
UpdateTablesNode(dbNode.TablesNode, s); |
|
||||||
|
|
||||||
// update the ViewsNode
|
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
private void UpdateTablesNode(TablesNode tablesNode, ConnectionStringSettings s) |
|
||||||
{ |
|
||||||
// get a list of table names for the current connection to work with
|
|
||||||
|
|
||||||
OleDbConnection connection = null; |
|
||||||
if (OleDbConnectionService.TryGetConnection(s.Name, out connection)) { |
|
||||||
// now use mymeta to retrieve table metadata
|
|
||||||
dbRoot m = new dbRoot(); |
|
||||||
bool connected = m.Connect(dbDriver.SQL, s.ConnectionString); |
|
||||||
if (!connected) { |
|
||||||
MessageBox.Show("Could not connect", "Connect failed"); |
|
||||||
return; |
|
||||||
} |
|
||||||
IDatabases dbs = m.Databases; |
|
||||||
OleDbConnectionStringBuilder builder = new OleDbConnectionStringBuilder(s.ConnectionString); |
|
||||||
String dbName = null; |
|
||||||
Object o = null; |
|
||||||
builder.TryGetValue("Initial Catalog", out o); |
|
||||||
dbName = (String)o; |
|
||||||
IDatabase db = dbs[dbName]; |
|
||||||
ITables tables = db.Tables; |
|
||||||
List<string> tableNames = new List<string>(); |
|
||||||
foreach (ITable t in tables) { |
|
||||||
tableNames.Add(t.Alias); |
|
||||||
TableNode tableNode = (TableNode)tablesNode.GetItemWithHeader(t.Alias); |
|
||||||
if (tableNode == null) { |
|
||||||
tableNode = new TableNode(); |
|
||||||
tableNode.Header = t.Alias; |
|
||||||
tablesNode.Items.Add(tableNode); |
|
||||||
} |
|
||||||
this.UpdateTableNode(tableNode, t); |
|
||||||
} |
|
||||||
tablesNode.RemoveItemsWithHeaderNotIn(tableNames); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private void UpdateTableNode(TableNode tableNode, ITable table) |
|
||||||
{ |
|
||||||
IColumns columns = table.Columns; |
|
||||||
List<string> columnNames = new List<string>(); |
|
||||||
foreach (IColumn column in columns) { |
|
||||||
string columnName = column.Alias; |
|
||||||
columnNames.Add(columnName); |
|
||||||
ColumnNode columnNode = (ColumnNode)tableNode.GetItemWithHeader(columnName); |
|
||||||
if (columnNode == null) { |
|
||||||
columnNode = new ColumnNode(); |
|
||||||
columnNode.Header = columnName; |
|
||||||
tableNode.Items.Add(columnNode); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private void UpdateColumnNode(ColumnNode columnNode, IColumn column) |
|
||||||
{ |
|
||||||
columnNode.Type = column.DataTypeName; |
|
||||||
columnNode.FieldName = column.Alias; |
|
||||||
// TODO: assign other properties
|
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a DbConnectionNode below the 'Data Connections' node of the ServerControl.
|
|
||||||
/// Simply iterate through the OleDbConnections available and:
|
|
||||||
/// - if a DbConnectionNode does not exist for one then add it
|
|
||||||
/// - if one does exist, then update its DbConnectionNodeState to correspond to the state of the
|
|
||||||
/// OleDbConnection.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dbConnectionsNode"></param>
|
|
||||||
public void UpdateDbConnectionsNode() |
|
||||||
{ |
|
||||||
log.Debug("updating connections node"); |
|
||||||
if(!_dbConnectionsNode.Dispatcher.CheckAccess()) { |
|
||||||
_dbConnectionsNode.Dispatcher.Invoke(DispatcherPriority.Normal, |
|
||||||
new UpdateDbConnectionsNodeDelegate(UpdateDbConnectionsNode)); |
|
||||||
} |
|
||||||
|
|
||||||
ConnectionStringSettingsCollection c |
|
||||||
= OleDbConnectionService.GetConnectionSettingsCollection(); |
|
||||||
|
|
||||||
// add a new DbConnectionNode for any connection that has been added
|
|
||||||
List<string> headers = new List<string>(); |
|
||||||
foreach (ConnectionStringSettings s in c) |
|
||||||
{ |
|
||||||
string settingsName = s.Name; |
|
||||||
log.Debug("got ConnectionStringSettings with name: " + settingsName); |
|
||||||
headers.Add(settingsName); |
|
||||||
DbConnectionNode dbNode = (DbConnectionNode)_dbConnectionsNode.GetItemWithHeader(settingsName); |
|
||||||
log.Debug("got DbConnectionNode with name: " + (dbNode == null? null:dbNode.Header)); |
|
||||||
if (dbNode == null) { |
|
||||||
// initial state for a new connection is always closed I think
|
|
||||||
log.Debug("creating new DbConnectionNode for settings with name: " + settingsName); |
|
||||||
dbNode = new DbConnectionNode(settingsName); |
|
||||||
_dbConnectionsNode.Items.Add(dbNode); |
|
||||||
} |
|
||||||
UpdateDbConnectionNode(dbNode, s); |
|
||||||
} |
|
||||||
_dbConnectionsNode.RemoveItemsWithHeaderNotIn(headers); |
|
||||||
} |
|
||||||
|
|
||||||
public delegate void UpdateDbConnectionsNodeDelegate(); |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Uses the DataLink dialog to define a new Oledb connection string,
|
|
||||||
/// test it, and adds it to config.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
public void AddConnectionButton_Clicked(object sender, RoutedEventArgs e) |
|
||||||
{ |
|
||||||
log.Debug("add connection button clicked handler"); |
|
||||||
MSDASC.DataLinks mydlg = new MSDASC.DataLinks(); |
|
||||||
OleDbConnection oleCon = new OleDbConnection(); |
|
||||||
ADODB._Connection aDOcon; |
|
||||||
|
|
||||||
//Cast the generic object that PromptNew returns to an ADODB._Connection.
|
|
||||||
aDOcon = (ADODB._Connection)mydlg.PromptNew(); |
|
||||||
if (aDOcon == null) |
|
||||||
{ |
|
||||||
return; |
|
||||||
} |
|
||||||
|
|
||||||
oleCon.ConnectionString = aDOcon.ConnectionString; |
|
||||||
oleCon.Open(); |
|
||||||
|
|
||||||
if (oleCon.State.ToString() == "Open") |
|
||||||
{ |
|
||||||
// If we get to here, we have a valid oledb
|
|
||||||
// connection string, at least on the basis of the current
|
|
||||||
// state of the platform that it refers to.
|
|
||||||
// Now construct a name for the connection string settings based on
|
|
||||||
// the attributes of the connection string and save it.
|
|
||||||
// VS08 assumes the following naming scheme:
|
|
||||||
// connection name ::= <provider name>.<host name>\<server name>.<catalog name>
|
|
||||||
|
|
||||||
string provider = oleCon.Provider; |
|
||||||
string source = oleCon.DataSource; |
|
||||||
string catalogue = oleCon.Database; |
|
||||||
string dbServerName = @provider + ":" + @source + "." + @catalogue; |
|
||||||
|
|
||||||
OleDbConnectionService.Put(dbServerName, oleCon.ConnectionString); |
|
||||||
OleDbConnectionService.Save(); |
|
||||||
oleCon.Close(); |
|
||||||
} |
|
||||||
else |
|
||||||
{ |
|
||||||
MessageBox.Show("Connection Failed"); |
|
||||||
} |
|
||||||
this.UpdateDbConnectionsNode(); |
|
||||||
} |
|
||||||
|
|
||||||
public void RefreshButton_Clicked(object sender, EventArgs eventArgs) |
|
||||||
{ |
|
||||||
log.Debug("refresh button clicked handler"); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,24 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 15:57 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of FunctionNode.
|
|
||||||
/// </summary>
|
|
||||||
public class FunctionNode: TreeViewItem |
|
||||||
{ |
|
||||||
public FunctionNode() |
|
||||||
{ |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 15:57 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of FunctionsNode.
|
|
||||||
/// </summary>
|
|
||||||
public class FunctionsNode: TreeViewItem |
|
||||||
{ |
|
||||||
public const string FUNCTIONS_NODE_HEADER = "Functions"; |
|
||||||
|
|
||||||
public FunctionsNode() |
|
||||||
{ |
|
||||||
this.Header = FUNCTIONS_NODE_HEADER; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,24 +0,0 @@ |
|||||||
<AddIn name = "ICSharpCode.ServerTools" |
|
||||||
author = "Dickon Field" |
|
||||||
url = "www.softwarefabric.com" |
|
||||||
description = "A collection of components and tools to help develop db-aware apps... and more"> |
|
||||||
|
|
||||||
<Manifest> |
|
||||||
<Identity name = "ICSharpCode.ServerTools"/> |
|
||||||
</Manifest> |
|
||||||
|
|
||||||
<Runtime> |
|
||||||
<Import assembly ="ICSharpCode.ServerTools.dll"/> |
|
||||||
<Import assembly="MyMeta.dll"/> |
|
||||||
<Import assembly="ICSharpCode.DataTools.dll"/> |
|
||||||
</Runtime> |
|
||||||
|
|
||||||
<Path name = "/SharpDevelop/Workbench/Pads"> |
|
||||||
<Pad id = "SharpServerToolsPad" |
|
||||||
category = "Main" |
|
||||||
title = "Server Explorer" |
|
||||||
icon = "ServerTool.Server" |
|
||||||
shortcut = "Control|Alt|D" |
|
||||||
class = "ICSharpCode.ServerTools.ServerBrowserHost"/> |
|
||||||
</Path> |
|
||||||
</AddIn> |
|
||||||
@ -1,85 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> |
|
||||||
<ClassDiagram Zoom="1" MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature"> |
|
||||||
<Class Name="ICSharpCode.ServerTools.DbControlController" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="0.5" Width="2.714167" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.ServerControl" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="3" Width="2.714167" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.DbConnectionNode" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="6.1" Width="2.557116" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Properties" Collapsed="False" /> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Enum Name="ICSharpCode.ServerTools.DbConnectionNodeState" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="8.3" Width="2.385544" /> |
|
||||||
<Compartments /> |
|
||||||
</Enum> |
|
||||||
<Class Name="ICSharpCode.ServerTools.DbConnectionsNode" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="9.7" Width="2.774967" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Properties" Collapsed="False" /> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.Properties.DbConnectionsNode" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="11.8" Width="2.670446" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.ServersNode" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="13.2" Width="2.321916" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.Servers.Properties.Resources" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="14.9" Width="2.472174" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Properties" Collapsed="False" /> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.Servers.Properties.Settings" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="17.4" Width="1.828166" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Properties" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.ServerBrowserHost" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="19.2" Width="2.542399" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Properties" Collapsed="False" /> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
<Compartment Name="Fields" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.TablesNode" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="21.6" Width="1.801403" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
<Class Name="ICSharpCode.ServerTools.TableNode" Collapsed="False"> |
|
||||||
<Position X="0.5" Y="23" Width="1.688073" /> |
|
||||||
<Compartments> |
|
||||||
<Compartment Name="Methods" Collapsed="False" /> |
|
||||||
</Compartments> |
|
||||||
</Class> |
|
||||||
</ClassDiagram> |
|
||||||
@ -1,207 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||||
<PropertyGroup> |
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
||||||
<ProductVersion>9.0.21022</ProductVersion> |
|
||||||
<SchemaVersion>2.0</SchemaVersion> |
|
||||||
<ProjectGuid>{8CF1EB90-324F-4AA9-BAA2-DEF87392CE86}</ProjectGuid> |
|
||||||
<OutputType>Library</OutputType> |
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|
||||||
<RootNamespace>ICSharpCode.ServerTools</RootNamespace> |
|
||||||
<AssemblyName>ICSharpCode.ServerTools</AssemblyName> |
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
|
||||||
<FileAlignment>512</FileAlignment> |
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
|
||||||
<WarningLevel>4</WarningLevel> |
|
||||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
|
||||||
<NoStdLib>False</NoStdLib> |
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
||||||
<DebugSymbols>true</DebugSymbols> |
|
||||||
<DebugType>Full</DebugType> |
|
||||||
<Optimize>false</Optimize> |
|
||||||
<OutputPath>..\..\..\..\AddIns\AddIns\Misc\ServerTools\</OutputPath> |
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
||||||
<ErrorReport>prompt</ErrorReport> |
|
||||||
<WarningLevel>4</WarningLevel> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
||||||
<DebugType>PdbOnly</DebugType> |
|
||||||
<Optimize>true</Optimize> |
|
||||||
<OutputPath>..\..\..\..\AddIns\AddIns\Misc\ServerTools\</OutputPath> |
|
||||||
<DefineConstants>TRACE</DefineConstants> |
|
||||||
<ErrorReport>prompt</ErrorReport> |
|
||||||
<WarningLevel>4</WarningLevel> |
|
||||||
<DebugSymbols>false</DebugSymbols> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
|
||||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> |
|
||||||
<RegisterForComInterop>False</RegisterForComInterop> |
|
||||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
|
||||||
<BaseAddress>4194304</BaseAddress> |
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
|
||||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
|
||||||
</PropertyGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Reference Include="System"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.configuration"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Core"> |
|
||||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.EnterpriseServices"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Windows.Forms"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Windows.Presentation"> |
|
||||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Xml.Linq"> |
|
||||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Data.DataSetExtensions"> |
|
||||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Data"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Xml"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="UIAutomationProvider"> |
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="WindowsBase"> |
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="PresentationCore"> |
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="PresentationFramework"> |
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="WindowsFormsIntegration"> |
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
</ItemGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Page Include="ServerControl.xaml"> |
|
||||||
<Generator>MSBuild:Compile</Generator> |
|
||||||
<SubType>Designer</SubType> |
|
||||||
</Page> |
|
||||||
<Compile Include="DbConnectionNode.cs" /> |
|
||||||
<Compile Include="DbConnectionsNode.cs" /> |
|
||||||
<Compile Include="DbControlController.cs" /> |
|
||||||
<Compile Include="ColumnNode.cs" /> |
|
||||||
<Compile Include="FunctionNode.cs" /> |
|
||||||
<Compile Include="FunctionsNode.cs" /> |
|
||||||
<Compile Include="TreeViewItemExtender.cs" /> |
|
||||||
<Compile Include="Properties\DbConnectionsNode.cs" /> |
|
||||||
<Compile Include="ServerControl.xaml.cs"> |
|
||||||
<DependentUpon>ServerControl.xaml</DependentUpon> |
|
||||||
<SubType>Code</SubType> |
|
||||||
</Compile> |
|
||||||
<Compile Include="ServersNode.cs" /> |
|
||||||
<Compile Include="StoredProcNode.cs" /> |
|
||||||
<Compile Include="StoreProcsNode.cs" /> |
|
||||||
<Compile Include="TableNode.cs" /> |
|
||||||
<Compile Include="TablesNode.cs" /> |
|
||||||
<Compile Include="ViewNode.cs" /> |
|
||||||
<Compile Include="ViewsNode.cs" /> |
|
||||||
<ProjectReference Include="..\..\..\Libraries\ICSharpCode.DataTools\ICSharpCode.DataTools.csproj"> |
|
||||||
<Project>{6CC3DF82-E815-483F-B4B5-85191064D981}</Project> |
|
||||||
<Name>ICSharpCode.DataTools</Name> |
|
||||||
<Private>True</Private> |
|
||||||
</ProjectReference> |
|
||||||
<ProjectReference Include="..\..\..\Libraries\MyMeta\MyMeta.csproj"> |
|
||||||
<Project>{9B771930-6F16-4EC7-8CBB-C7B337EF5651}</Project> |
|
||||||
<Name>MyMeta</Name> |
|
||||||
</ProjectReference> |
|
||||||
<ProjectReference Include="..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
|
||||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
|
||||||
<Name>ICSharpCode.SharpDevelop</Name> |
|
||||||
<Private>False</Private> |
|
||||||
</ProjectReference> |
|
||||||
<ProjectReference Include="..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
|
||||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
|
||||||
<Name>ICSharpCode.Core</Name> |
|
||||||
<Private>False</Private> |
|
||||||
</ProjectReference> |
|
||||||
<COMReference Include="ADODB"> |
|
||||||
<Guid>{EF53050B-882E-4776-B643-EDA472E8E3F2}</Guid> |
|
||||||
<VersionMajor>2</VersionMajor> |
|
||||||
<VersionMinor>7</VersionMinor> |
|
||||||
<Lcid>0</Lcid> |
|
||||||
<WrapperTool>tlbimp</WrapperTool> |
|
||||||
<Isolated>False</Isolated> |
|
||||||
<Private>True</Private> |
|
||||||
</COMReference> |
|
||||||
<COMReference Include="MSDASC"> |
|
||||||
<Guid>{2206CEB0-19C1-11D1-89E0-00C04FD7A829}</Guid> |
|
||||||
<VersionMajor>1</VersionMajor> |
|
||||||
<VersionMinor>0</VersionMinor> |
|
||||||
<Lcid>0</Lcid> |
|
||||||
<WrapperTool>tlbimp</WrapperTool> |
|
||||||
<Isolated>False</Isolated> |
|
||||||
<Private>True</Private> |
|
||||||
</COMReference> |
|
||||||
<None Include="ICSharpCode.ServerTools.addin"> |
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
|
||||||
</None> |
|
||||||
<Content Include="ICSharpCode.ServerTools.cd" /> |
|
||||||
</ItemGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Compile Include="Properties\AssemblyInfo.cs"> |
|
||||||
<SubType>Code</SubType> |
|
||||||
</Compile> |
|
||||||
<Compile Include="Properties\Resources.Designer.cs"> |
|
||||||
<AutoGen>True</AutoGen> |
|
||||||
<DesignTime>True</DesignTime> |
|
||||||
<DependentUpon>Resources.resx</DependentUpon> |
|
||||||
</Compile> |
|
||||||
<Compile Include="Properties\Settings.Designer.cs"> |
|
||||||
<AutoGen>True</AutoGen> |
|
||||||
<DependentUpon>Settings.settings</DependentUpon> |
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
|
||||||
</Compile> |
|
||||||
<Compile Include="ServerBrowserHost.cs" /> |
|
||||||
<EmbeddedResource Include="Properties\Resources.resx"> |
|
||||||
<Generator>ResXFileCodeGenerator</Generator> |
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
|
||||||
<SubType>Designer</SubType> |
|
||||||
</EmbeddedResource> |
|
||||||
<None Include="Properties\Settings.settings"> |
|
||||||
<Generator>SettingsSingleFileGenerator</Generator> |
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
|
||||||
</None> |
|
||||||
<AppDesigner Include="Properties\" /> |
|
||||||
</ItemGroup> |
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|
||||||
Other similar extension points exist, see Microsoft.Common.targets. |
|
||||||
<Target Name="BeforeBuild"> |
|
||||||
</Target> |
|
||||||
<Target Name="AfterBuild"> |
|
||||||
</Target> |
|
||||||
--> |
|
||||||
</Project> |
|
||||||
@ -1,57 +0,0 @@ |
|||||||
using System.Reflection; |
|
||||||
using System.Resources; |
|
||||||
using System.Runtime.CompilerServices; |
|
||||||
using System.Runtime.InteropServices; |
|
||||||
using System.Windows; |
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("SharpServerTools.Servers")] |
|
||||||
[assembly: AssemblyDescription("")] |
|
||||||
[assembly: AssemblyConfiguration("")] |
|
||||||
[assembly: AssemblyCompany("")] |
|
||||||
[assembly: AssemblyProduct("SharpServerTools.Servers")] |
|
||||||
[assembly: AssemblyCopyright("Copyright © 2007")] |
|
||||||
[assembly: AssemblyTrademark("")] |
|
||||||
[assembly: AssemblyCulture("")] |
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)] |
|
||||||
|
|
||||||
//In order to begin building localizable applications, set
|
|
||||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
|
||||||
//inside a <PropertyGroup>. For example, if you are using US english
|
|
||||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
|
||||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
|
||||||
//the line below to match the UICulture setting in the project file.
|
|
||||||
|
|
||||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
|
||||||
|
|
||||||
|
|
||||||
[assembly: ThemeInfo( |
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// or application resource dictionaries)
|
|
||||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// app, or any theme specific resource dictionaries)
|
|
||||||
)] |
|
||||||
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")] |
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|
||||||
|
|
||||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("TestServerControl")] |
|
||||||
@ -1,24 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 22/01/2008 |
|
||||||
* Time: 17:39 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools.Properties |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of DbConnectionsNode.
|
|
||||||
/// </summary>
|
|
||||||
public class DbConnectionsNode: TreeViewItem |
|
||||||
{ |
|
||||||
public DbConnectionsNode() |
|
||||||
{ |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,71 +0,0 @@ |
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:2.0.50727.1378
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools.Servers.Properties |
|
||||||
{ |
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
|
||||||
/// </summary>
|
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
|
||||||
// class via a tool like ResGen or Visual Studio.
|
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
|
||||||
// with the /str option, or rebuild your VS project.
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] |
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
||||||
internal class Resources |
|
||||||
{ |
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan; |
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture; |
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] |
|
||||||
internal Resources() |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager |
|
||||||
{ |
|
||||||
get |
|
||||||
{ |
|
||||||
if ((resourceMan == null)) |
|
||||||
{ |
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SharpServerTools.Servers.Properties.Resources", typeof(Resources).Assembly); |
|
||||||
resourceMan = temp; |
|
||||||
} |
|
||||||
return resourceMan; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
|
||||||
/// resource lookups using this strongly typed resource class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
||||||
internal static global::System.Globalization.CultureInfo Culture |
|
||||||
{ |
|
||||||
get |
|
||||||
{ |
|
||||||
return resourceCulture; |
|
||||||
} |
|
||||||
set |
|
||||||
{ |
|
||||||
resourceCulture = value; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,117 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<root> |
|
||||||
<!-- |
|
||||||
Microsoft ResX Schema |
|
||||||
|
|
||||||
Version 2.0 |
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format |
|
||||||
that is mostly human readable. The generation and parsing of the |
|
||||||
various data types are done through the TypeConverter classes |
|
||||||
associated with the data types. |
|
||||||
|
|
||||||
Example: |
|
||||||
|
|
||||||
... ado.net/XML headers & schema ... |
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
||||||
<resheader name="version">2.0</resheader> |
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
||||||
</data> |
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
||||||
<comment>This is a comment</comment> |
|
||||||
</data> |
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple |
|
||||||
name/value pairs. |
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a |
|
||||||
type or mimetype. Type corresponds to a .NET class that support |
|
||||||
text/value conversion through the TypeConverter architecture. |
|
||||||
Classes that don't support this are serialized and stored with the |
|
||||||
mimetype set. |
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the |
|
||||||
ResXResourceReader how to depersist the object. This is currently not |
|
||||||
extensible. For a given mimetype the value must be set accordingly: |
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
||||||
that the ResXResourceWriter will generate, however the reader can |
|
||||||
read any of the formats listed below. |
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64 |
|
||||||
value : The object must be serialized with |
|
||||||
: System.Serialization.Formatters.Binary.BinaryFormatter |
|
||||||
: and then encoded with base64 encoding. |
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64 |
|
||||||
value : The object must be serialized with |
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
||||||
: and then encoded with base64 encoding. |
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
||||||
value : The object must be serialized into a byte array |
|
||||||
: using a System.ComponentModel.TypeConverter |
|
||||||
: and then encoded with base64 encoding. |
|
||||||
--> |
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
||||||
<xsd:element name="root" msdata:IsDataSet="true"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:choice maxOccurs="unbounded"> |
|
||||||
<xsd:element name="metadata"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:sequence> |
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
||||||
</xsd:sequence> |
|
||||||
<xsd:attribute name="name" type="xsd:string" /> |
|
||||||
<xsd:attribute name="type" type="xsd:string" /> |
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
<xsd:element name="assembly"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:attribute name="alias" type="xsd:string" /> |
|
||||||
<xsd:attribute name="name" type="xsd:string" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
<xsd:element name="data"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:sequence> |
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
||||||
</xsd:sequence> |
|
||||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> |
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
<xsd:element name="resheader"> |
|
||||||
<xsd:complexType> |
|
||||||
<xsd:sequence> |
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
||||||
</xsd:sequence> |
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
</xsd:choice> |
|
||||||
</xsd:complexType> |
|
||||||
</xsd:element> |
|
||||||
</xsd:schema> |
|
||||||
<resheader name="resmimetype"> |
|
||||||
<value>text/microsoft-resx</value> |
|
||||||
</resheader> |
|
||||||
<resheader name="version"> |
|
||||||
<value>2.0</value> |
|
||||||
</resheader> |
|
||||||
<resheader name="reader"> |
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
||||||
</resheader> |
|
||||||
<resheader name="writer"> |
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
||||||
</resheader> |
|
||||||
</root> |
|
||||||
@ -1,30 +0,0 @@ |
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:2.0.50727.1378
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools.Servers.Properties |
|
||||||
{ |
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] |
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase |
|
||||||
{ |
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
|
||||||
|
|
||||||
public static Settings Default |
|
||||||
{ |
|
||||||
get |
|
||||||
{ |
|
||||||
return defaultInstance; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,7 +0,0 @@ |
|||||||
<?xml version='1.0' encoding='utf-8'?> |
|
||||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> |
|
||||||
<Profiles> |
|
||||||
<Profile Name="(Default)" /> |
|
||||||
</Profiles> |
|
||||||
<Settings /> |
|
||||||
</SettingsFile> |
|
||||||
@ -1,63 +0,0 @@ |
|||||||
// <file>
|
|
||||||
// <copyright see="prj:///doc/copyright.txt"/>
|
|
||||||
// <license see="prj:///doc/license.txt"/>
|
|
||||||
// <owner name="Dickon Field" email=""/>
|
|
||||||
// <version>$Revision$</version>
|
|
||||||
// </file>
|
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Forms; |
|
||||||
using System.Windows.Forms.Integration; |
|
||||||
using ICSharpCode.Core; |
|
||||||
using ICSharpCode.SharpDevelop.Gui; |
|
||||||
using ICSharpCode.ServerTools; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Enables a user to browse metadata associated with a db server and to open resources
|
|
||||||
/// referenced therein. The intention is to extend this to other server processes over
|
|
||||||
/// time.
|
|
||||||
/// </summary>
|
|
||||||
public class ServerBrowserHost : AbstractPadContent |
|
||||||
{ |
|
||||||
ElementHost ctl; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ServerBrowserTool hosts one or more TreeViews providing views of types
|
|
||||||
/// of server. Currently it shows only relational database servers.
|
|
||||||
/// </summary>
|
|
||||||
public ServerBrowserHost() |
|
||||||
{ |
|
||||||
LoggingService.Debug("Loading ServerBrowserHost"); |
|
||||||
ctl = new ElementHost(); |
|
||||||
ServerControl serverControl = new ServerControl(); |
|
||||||
ctl.Child = serverControl; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
|
|
||||||
/// </summary>
|
|
||||||
public override Control Control { |
|
||||||
get { |
|
||||||
return ctl; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Rebuildes the pad
|
|
||||||
/// </summary>
|
|
||||||
public override void RedrawContent() |
|
||||||
{ |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Cleans up all used resources
|
|
||||||
/// </summary>
|
|
||||||
public override void Dispose() |
|
||||||
{ |
|
||||||
ctl.Dispose(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,23 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<UserControl |
|
||||||
x:Class="ICSharpCode.ServerTools.ServerControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
||||||
Height="300" |
|
||||||
Width="300"> |
|
||||||
<DockPanel> |
|
||||||
<ToolBar |
|
||||||
DockPanel.Dock="Top" |
|
||||||
Name="serverToolBar" |
|
||||||
Grid.Column="0" |
|
||||||
Grid.Row="0"> |
|
||||||
<Button |
|
||||||
Name="refreshButton">R</Button> |
|
||||||
<Button |
|
||||||
Name="stopRefreshButton">S</Button> |
|
||||||
<Button |
|
||||||
Name="addConnectionButton">A</Button> |
|
||||||
</ToolBar> |
|
||||||
<TreeView |
|
||||||
Name="serverTree"> |
|
||||||
</TreeView> |
|
||||||
</DockPanel> |
|
||||||
</UserControl> |
|
||||||
@ -1,47 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.Linq; |
|
||||||
using System.Text; |
|
||||||
using System.Windows; |
|
||||||
using System.Windows.Controls; |
|
||||||
using System.Windows.Data; |
|
||||||
using System.Windows.Documents; |
|
||||||
using System.Windows.Input; |
|
||||||
using System.Windows.Media; |
|
||||||
using System.Windows.Media.Imaging; |
|
||||||
using System.Windows.Navigation; |
|
||||||
using System.Windows.Shapes; |
|
||||||
using System.Data; |
|
||||||
using System.Data.OleDb; |
|
||||||
using System.Data.Common; |
|
||||||
using System.Configuration; |
|
||||||
using System.Collections.Generic; |
|
||||||
|
|
||||||
using ICSharpCode.DataTools; |
|
||||||
using log = ICSharpCode.Core.LoggingService; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for UserControl1.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class ServerControl : UserControl |
|
||||||
{ |
|
||||||
private DbConnectionsNode _dbConnectionsNode; |
|
||||||
private ServersNode _serversNode; |
|
||||||
public const int DATA_CONNECTIONS_VIEW_INDEX = 0; |
|
||||||
public const int SERVERS_VIEW_INDEX = 1; |
|
||||||
|
|
||||||
public ServerControl() |
|
||||||
{ |
|
||||||
InitializeComponent(); |
|
||||||
_dbConnectionsNode = new DbConnectionsNode(); |
|
||||||
_serversNode = new ServersNode(); |
|
||||||
this.serverTree.Items.Add(_dbConnectionsNode); |
|
||||||
this.serverTree.Items.Add(_serversNode); |
|
||||||
DbControlController dbControlController = new DbControlController(_dbConnectionsNode); |
|
||||||
this.addConnectionButton.Click += dbControlController.AddConnectionButton_Clicked; |
|
||||||
this.refreshButton.Click += dbControlController.RefreshButton_Clicked; |
|
||||||
dbControlController.UpdateDbConnectionsNode(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 22/01/2008 |
|
||||||
* Time: 18:04 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of ServersNode.
|
|
||||||
/// </summary>
|
|
||||||
public class ServersNode: TreeViewItem |
|
||||||
{ |
|
||||||
public const string SERVERS_NODE_HEADER = "Servers"; |
|
||||||
|
|
||||||
public ServersNode() |
|
||||||
{ |
|
||||||
this.Header = SERVERS_NODE_HEADER; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 16:15 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of StoreProcsNode.
|
|
||||||
/// </summary>
|
|
||||||
public class StoreProcsNode: TreeViewItem |
|
||||||
{ |
|
||||||
public const string STORED_PROCS_NODE_HEADER = "Stored Procedures"; |
|
||||||
|
|
||||||
public StoreProcsNode() |
|
||||||
{ |
|
||||||
this.Header = STORED_PROCS_NODE_HEADER; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,24 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 16:15 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of StoredProcNode.
|
|
||||||
/// </summary>
|
|
||||||
public class StoredProcNode: TreeViewItem |
|
||||||
{ |
|
||||||
public StoredProcNode() |
|
||||||
{ |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,24 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 15:46 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of TableNode.
|
|
||||||
/// </summary>
|
|
||||||
public class TableNode: TreeViewItem |
|
||||||
{ |
|
||||||
public TableNode() |
|
||||||
{ |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 15:42 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of TablesNode.
|
|
||||||
/// </summary>
|
|
||||||
public class TablesNode: TreeViewItem |
|
||||||
{ |
|
||||||
public const string TABLES_NODE_HEADER = "Tables"; |
|
||||||
|
|
||||||
public TablesNode() |
|
||||||
{ |
|
||||||
this.Header = TABLES_NODE_HEADER; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,72 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 16:30 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
using System.Windows.Forms; |
|
||||||
using System.Collections.Generic; |
|
||||||
using log=ICSharpCode.Core.LoggingService; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of HeaderIndexedTreeViewItem.
|
|
||||||
/// </summary>
|
|
||||||
public static class TreeViewItemExtender |
|
||||||
{ |
|
||||||
public static TreeViewItem GetItemWithHeader(this TreeViewItem t, string header) |
|
||||||
{ |
|
||||||
log.Debug("looking for item with name: " + header); |
|
||||||
foreach(Object o in t.Items) { |
|
||||||
TreeViewItem item = o as TreeViewItem; |
|
||||||
if (item != null) { |
|
||||||
string h = (string)item.Header; |
|
||||||
log.Debug("looking at item with name: " + h); |
|
||||||
if (h.Equals(header)) { |
|
||||||
log.Debug("found item with name: " + header); |
|
||||||
return item; |
|
||||||
} |
|
||||||
} else { |
|
||||||
MessageBox.Show("While navigating the db connection tree an object not of type TreeViewItem was found", |
|
||||||
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); |
|
||||||
log.Error("found and item in the DbConnectionsNode tree that is not a TreeViewItem"); |
|
||||||
} |
|
||||||
} |
|
||||||
log.Debug("could not find item with name: " + header); |
|
||||||
return null; |
|
||||||
} |
|
||||||
|
|
||||||
public static void RemoveItemWithHeader(this TreeViewItem t, string header) |
|
||||||
{ |
|
||||||
foreach(Object o in t.Items) { |
|
||||||
HeaderedContentControl h = o as HeaderedContentControl; |
|
||||||
if (h != null) { |
|
||||||
if (h.Header.Equals(header)) { |
|
||||||
log.Debug("removing item with name: " + header); |
|
||||||
t.Items.Remove(h); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public static void RemoveItemsWithHeaderNotIn(this TreeViewItem t, IList<string> headers) |
|
||||||
{ |
|
||||||
foreach(Object o in t.Items) { |
|
||||||
HeaderedContentControl h = o as HeaderedContentControl; |
|
||||||
if (h != null) { |
|
||||||
string header = h.Header as string; |
|
||||||
if (!(headers.Contains(header))) { |
|
||||||
log.Debug("item with name: " + header + " was not in the keep-list, so removing it"); |
|
||||||
t.Items.Remove(h); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,24 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 15:56 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of ViewNode.
|
|
||||||
/// </summary>
|
|
||||||
public class ViewNode: TreeViewItem |
|
||||||
{ |
|
||||||
public ViewNode() |
|
||||||
{ |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: dickon |
|
||||||
* Date: 07/02/2008 |
|
||||||
* Time: 15:56 |
|
||||||
* |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Controls; |
|
||||||
|
|
||||||
namespace ICSharpCode.ServerTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of ViewsNode.
|
|
||||||
/// </summary>
|
|
||||||
public class ViewsNode: TreeViewItem |
|
||||||
{ |
|
||||||
public const string VIEWS_NODE_HEADER = "Views"; |
|
||||||
|
|
||||||
public ViewsNode() |
|
||||||
{ |
|
||||||
this.Header = VIEWS_NODE_HEADER; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,87 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||||
<PropertyGroup> |
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
||||||
<ProductVersion>9.0.20706</ProductVersion> |
|
||||||
<SchemaVersion>2.0</SchemaVersion> |
|
||||||
<ProjectGuid>{6CC3DF82-E815-483F-B4B5-85191064D981}</ProjectGuid> |
|
||||||
<OutputType>Library</OutputType> |
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|
||||||
<RootNamespace>ICSharpCode.DataTools</RootNamespace> |
|
||||||
<AssemblyName>ICSharpCode.DataTools</AssemblyName> |
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
|
||||||
<FileAlignment>512</FileAlignment> |
|
||||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
|
||||||
<NoStdLib>False</NoStdLib> |
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
||||||
<DebugSymbols>true</DebugSymbols> |
|
||||||
<DebugType>Full</DebugType> |
|
||||||
<Optimize>false</Optimize> |
|
||||||
<OutputPath>..\..\..\AddIns\AddIns\Misc\ServerTools\</OutputPath> |
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
||||||
<ErrorReport>prompt</ErrorReport> |
|
||||||
<WarningLevel>4</WarningLevel> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
||||||
<DebugType>PdbOnly</DebugType> |
|
||||||
<Optimize>true</Optimize> |
|
||||||
<OutputPath>..\..\..\AddIns\AddIns\Misc\ServerTools\</OutputPath> |
|
||||||
<DefineConstants>TRACE</DefineConstants> |
|
||||||
<ErrorReport>prompt</ErrorReport> |
|
||||||
<WarningLevel>4</WarningLevel> |
|
||||||
<DebugSymbols>false</DebugSymbols> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
|
||||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> |
|
||||||
<RegisterForComInterop>False</RegisterForComInterop> |
|
||||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
|
||||||
<BaseAddress>4194304</BaseAddress> |
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
|
||||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
|
||||||
</PropertyGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Reference Include="System"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.configuration"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Data"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System.Xml"> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
</ItemGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Compile Include="OleDbUtils.cs" /> |
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
||||||
</ItemGroup> |
|
||||||
<ItemGroup> |
|
||||||
<ProjectReference Include="..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
|
||||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
|
||||||
<Name>ICSharpCode.SharpDevelop</Name> |
|
||||||
<Private>False</Private> |
|
||||||
</ProjectReference> |
|
||||||
<ProjectReference Include="..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
|
||||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
|
||||||
<Name>ICSharpCode.Core</Name> |
|
||||||
<Private>False</Private> |
|
||||||
</ProjectReference> |
|
||||||
</ItemGroup> |
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|
||||||
Other similar extension points exist, see Microsoft.Common.targets. |
|
||||||
<Target Name="BeforeBuild"> |
|
||||||
</Target> |
|
||||||
<Target Name="AfterBuild"> |
|
||||||
</Target> |
|
||||||
--> |
|
||||||
</Project> |
|
||||||
@ -1,257 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.Collections.Generic; |
|
||||||
using System.Text; |
|
||||||
using System.Configuration; |
|
||||||
using System.Data.Common; |
|
||||||
using System.Data; |
|
||||||
using System.Data.OleDb; |
|
||||||
using System.IO; |
|
||||||
using System.Xml.Serialization; |
|
||||||
using ICSharpCode.Core; |
|
||||||
using log = ICSharpCode.Core.LoggingService; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace ICSharpCode.DataTools |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// <para>This class maintains a dictionary of OleDbConnections backed by a file -
|
|
||||||
/// it does not open the connections or maintain a pool of connections. That would be
|
|
||||||
/// a bad idea since most oledb providers implement connection pooling themselves.</para>
|
|
||||||
/// <para>It does validate connection strings as they are submitted - or rather it delegates
|
|
||||||
/// this validation to the <code>OleDbConnectionStringBuilder</code>
|
|
||||||
/// </para>
|
|
||||||
/// </summary>
|
|
||||||
public static class OleDbConnectionService |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Returns a single connection, unopened
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="connectionName"></param>
|
|
||||||
/// <returns>An OleDbConnection object if the connectioName refers to an oledb connection, otherwise null</returns>
|
|
||||||
/// <exception cref="ArgumentException">thrown if the name of the connection is found,
|
|
||||||
/// but is not a valid oledb connection string</exception>
|
|
||||||
///
|
|
||||||
public const string CONNECTION_STRINGS_FILE = "DatabaseConnections.xml"; |
|
||||||
|
|
||||||
// a standard .net class representing a collection of connection settings
|
|
||||||
private static ConnectionStringSettingsCollection cssc = null; |
|
||||||
|
|
||||||
// an internal cache of OleDbConnections that have so far been created.
|
|
||||||
// Note that OleDbConnectionService does not know of care whether the connections are open or closed
|
|
||||||
// it simply keeps a cache of the created objects indexed by the name of the ConnectionStringSettings.
|
|
||||||
|
|
||||||
private static Dictionary<string, OleDbConnection> connections = |
|
||||||
new Dictionary<string, OleDbConnection>(); |
|
||||||
|
|
||||||
private static bool TryGet(string connectionName, out OleDbConnection conn) |
|
||||||
{ |
|
||||||
try |
|
||||||
{ |
|
||||||
ConnectionStringSettingsCollection settingsCollection = GetConnectionSettingsCollection(); |
|
||||||
ConnectionStringSettings settings = settingsCollection[connectionName]; |
|
||||||
string connString = settings.ConnectionString; |
|
||||||
OleDbConnectionStringBuilder builder = new OleDbConnectionStringBuilder(connString); // ArgumentException thrown here
|
|
||||||
conn = new OleDbConnection(builder.ConnectionString); |
|
||||||
return true; |
|
||||||
} |
|
||||||
catch (ArgumentException) |
|
||||||
{ |
|
||||||
conn = null; |
|
||||||
return false; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public static bool TryGetConnection(string connectionName, out OleDbConnection connection) |
|
||||||
{ |
|
||||||
if (connections.TryGetValue(connectionName, out connection)) { |
|
||||||
return true; |
|
||||||
} else { |
|
||||||
if (TryGet(connectionName, out connection)) { |
|
||||||
connections.Add(connectionName, connection); |
|
||||||
return true; |
|
||||||
}else { |
|
||||||
return false; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Validates and adds an oledb connection string to the internal cache.
|
|
||||||
/// Note that this does not persist it - call Save() immediately after this
|
|
||||||
/// you want the connection string to be available between sessions.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name">an arbitrary display for the connection which can be used to
|
|
||||||
/// display the connection. There can therefore be multiple instances of the same
|
|
||||||
/// connection in use.</param>
|
|
||||||
/// <param name="connectionString"></param>
|
|
||||||
public static void Put(string name, string connectionString) |
|
||||||
{ |
|
||||||
// check that it is an oledb connection string
|
|
||||||
OleDbConnectionStringBuilder builder = new OleDbConnectionStringBuilder(connectionString); |
|
||||||
// if an exception wasn't thrown then its a valid connection string, so add it to
|
|
||||||
// the cache
|
|
||||||
ConnectionStringSettings st = new ConnectionStringSettings(name, connectionString); |
|
||||||
cssc.Add(st); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns all Connections unopened
|
|
||||||
/// </summary>
|
|
||||||
public static Dictionary<string, OleDbConnection> Connections |
|
||||||
{ |
|
||||||
get |
|
||||||
{ |
|
||||||
// iterate through all connection strings trying to create a connection
|
|
||||||
// from each. If an exception is thrown by the OleDbFactory then do not return it
|
|
||||||
ConnectionStringSettingsCollection settingsCollection = GetConnectionSettingsCollection(); |
|
||||||
List<OleDbConnection> results = new List<OleDbConnection>(); |
|
||||||
foreach (ConnectionStringSettings c in settingsCollection) |
|
||||||
{ |
|
||||||
if (connections.ContainsKey(c.Name)) { |
|
||||||
continue; |
|
||||||
} |
|
||||||
try |
|
||||||
{ |
|
||||||
OleDbConnectionStringBuilder builder = new OleDbConnectionStringBuilder(c.ConnectionString); // ArgumentException thrown here
|
|
||||||
OleDbConnection conn = new OleDbConnection(builder.ConnectionString); |
|
||||||
connections.Add(c.Name, conn); |
|
||||||
} |
|
||||||
catch (ArgumentException) |
|
||||||
{ |
|
||||||
log.Info("an invalid connection string was found in the file " + |
|
||||||
CONNECTION_STRINGS_FILE + ": " + c.ToString()); |
|
||||||
} |
|
||||||
} |
|
||||||
return connections; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public static ConnectionStringSettingsCollection GetConnectionSettingsCollection() |
|
||||||
{ |
|
||||||
if (cssc != null) |
|
||||||
{ |
|
||||||
return cssc; |
|
||||||
} |
|
||||||
|
|
||||||
cssc = new ConnectionStringSettingsCollection(); |
|
||||||
|
|
||||||
// Does the connections file exist - if not return an empty collection
|
|
||||||
string configPath = PropertyService.ConfigDirectory; |
|
||||||
string filePath = Path.Combine(configPath, CONNECTION_STRINGS_FILE); |
|
||||||
|
|
||||||
if (!File.Exists(filePath)) |
|
||||||
{ |
|
||||||
return cssc; |
|
||||||
} |
|
||||||
try |
|
||||||
{ |
|
||||||
using (Stream sr = new FileStream(filePath, FileMode.Open)) |
|
||||||
{ |
|
||||||
while (sr.Length > 0) |
|
||||||
{ |
|
||||||
XmlSerializer x = new XmlSerializer(typeof(ConnectionStringSettingsXMLSerializerWrapper)); |
|
||||||
ConnectionStringSettingsXMLSerializerWrapper csw |
|
||||||
= (ConnectionStringSettingsXMLSerializerWrapper)x.Deserialize(sr); |
|
||||||
ConnectionStringSettings cs = csw.ConnectionStringSettings; |
|
||||||
cssc.Add(cs); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
catch (Exception) |
|
||||||
{ |
|
||||||
// again, if the file contains some extraneous data it must have been corrupted or
|
|
||||||
// manually edited - in this case ignore it
|
|
||||||
log.Info("bad data found trying to read in the ConnectionSettingsCollection from file - " |
|
||||||
+ "please check the content of the file at: " + filePath); |
|
||||||
} |
|
||||||
return cssc; |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Save whatever is in the cache to disc - overwriting whatever is there
|
|
||||||
/// </summary>
|
|
||||||
public static void Save() |
|
||||||
{ |
|
||||||
log.Debug("persisting oledb connection strings"); |
|
||||||
string configPath = PropertyService.ConfigDirectory; |
|
||||||
string filePath = Path.Combine(configPath, CONNECTION_STRINGS_FILE); |
|
||||||
try |
|
||||||
{ |
|
||||||
log.Debug("existing file found, so deleting it to be replaced"); |
|
||||||
File.Delete(filePath); |
|
||||||
} |
|
||||||
catch (Exception) |
|
||||||
{ |
|
||||||
// this should just indicate that the file does not exist
|
|
||||||
log.Debug("no connection settings file found while saving - will create a new one"); |
|
||||||
} |
|
||||||
|
|
||||||
using (Stream sw = new FileStream(filePath, FileMode.CreateNew)) |
|
||||||
{ |
|
||||||
XmlSerializer xs = new XmlSerializer(typeof(ConnectionStringSettingsXMLSerializerWrapper)); |
|
||||||
foreach (ConnectionStringSettings cs in cssc) |
|
||||||
{ |
|
||||||
try |
|
||||||
{ |
|
||||||
log.Debug("serialising as xml and storing: " + cs.ToString()); |
|
||||||
ConnectionStringSettingsXMLSerializerWrapper csw |
|
||||||
= new ConnectionStringSettingsXMLSerializerWrapper(cs); |
|
||||||
xs.Serialize(sw, csw); |
|
||||||
} |
|
||||||
catch(Exception e) |
|
||||||
{ |
|
||||||
throw (e); |
|
||||||
// TODO: do something sensible with the exception if it occurs
|
|
||||||
//log.Debug("failed to write ConnectionStringSettings: " + cs.ToString());
|
|
||||||
//log.Debug(e.StackTrace);
|
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public class ConnectionStringSettingsXMLSerializerWrapper |
|
||||||
{ |
|
||||||
private ConnectionStringSettings settings; |
|
||||||
|
|
||||||
public ConnectionStringSettingsXMLSerializerWrapper() |
|
||||||
{ |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
public ConnectionStringSettingsXMLSerializerWrapper(ConnectionStringSettings settings) |
|
||||||
{ |
|
||||||
this.settings = settings; |
|
||||||
} |
|
||||||
|
|
||||||
public string Name { |
|
||||||
get { |
|
||||||
return settings.Name; |
|
||||||
} |
|
||||||
set { |
|
||||||
ConnectionStringSettings.Name = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public string ConnectionString { |
|
||||||
get { |
|
||||||
return settings.ConnectionString; |
|
||||||
} |
|
||||||
set { |
|
||||||
ConnectionStringSettings.ConnectionString = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
[XmlIgnore] |
|
||||||
public ConnectionStringSettings ConnectionStringSettings { |
|
||||||
get { |
|
||||||
if (settings == null) { |
|
||||||
settings = new ConnectionStringSettings(); |
|
||||||
} |
|
||||||
return settings; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,28 +0,0 @@ |
|||||||
using System.Reflection; |
|
||||||
using System.Runtime.CompilerServices; |
|
||||||
using System.Runtime.InteropServices; |
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("ICSharpCode.DataTools")] |
|
||||||
[assembly: AssemblyDescription("")] |
|
||||||
[assembly: AssemblyConfiguration("")] |
|
||||||
[assembly: AssemblyCompany("")] |
|
||||||
[assembly: AssemblyProduct("ICSharpCode.DataTools")] |
|
||||||
[assembly: AssemblyCopyright("Copyright © 2007")] |
|
||||||
[assembly: AssemblyTrademark("")] |
|
||||||
[assembly: AssemblyCulture("")] |
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")] |
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|
||||||
Binary file not shown.
Loading…
Reference in new issue