Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2861 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
5 changed files with 192 additions and 15 deletions
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: dickon |
||||
* Date: 15/01/2008 |
||||
* Time: 16:47 |
||||
* |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Controls; |
||||
using System.Collections.Generic; |
||||
using System.Data.OleDb; |
||||
|
||||
using dbtool = ICSharpCode.DataTools.OleDbConnectionUtil; |
||||
|
||||
namespace ICSharpCode.ServerTools |
||||
{ |
||||
/// <summary>
|
||||
/// Description of DbToolController.
|
||||
/// </summary>
|
||||
public static class DbControlController |
||||
{ |
||||
private static Dictionary<string, OleDbConnection> connections = |
||||
new Dictionary<string, OleDbConnection>(); |
||||
|
||||
/// <summary>
|
||||
/// Lookup the connection for the named db node,
|
||||
/// </summary>
|
||||
/// <param name="dbNode"></param>
|
||||
public static void BuildDbNode(TreeViewItem dbNode, string connectionName) |
||||
{ |
||||
|
||||
} |
||||
|
||||
public static bool TryGetConnection(string connectionName, out OleDbConnection connection) |
||||
{ |
||||
if (connections.TryGetValue(connectionName, out connection)) { |
||||
return true; |
||||
} else { |
||||
// TODO: use OleDbUtils to get a connection if possible.
|
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: dickon |
||||
* Date: 15/01/2008 |
||||
* Time: 18:15 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Controls; |
||||
|
||||
namespace ICSharpCode.ServerTools |
||||
{ |
||||
/// <summary>
|
||||
/// Description of DbNode.
|
||||
/// </summary>
|
||||
public class DbControlNode : TreeViewItem |
||||
{ |
||||
private DbControlNodeState state; |
||||
|
||||
public DbControlNode(string name) |
||||
{ |
||||
this.Name = name; |
||||
} |
||||
|
||||
public DbControlNode(string name, DbControlNodeState state) |
||||
{ |
||||
this.Name = name; |
||||
this.state = state; |
||||
} |
||||
|
||||
public DbControlNodeState State { |
||||
get { |
||||
return this.state; |
||||
} |
||||
set { |
||||
this.state = value; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public enum DbControlNodeState |
||||
{ |
||||
Open, |
||||
Closed |
||||
} |
||||
} |
||||
Loading…
Reference in new issue