From 9505128e6f4a043e589898bd9129a629afd5bddf Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 31 May 2007 10:47:38 +0000 Subject: The start of a beautiful thing! (eeek inventory!) --- .../MySQLInventoryData.cs | 39 ++++++++++++++++++++++ .../OpenGrid.Framework.Data/InventoryData.cs | 31 +++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs create mode 100644 OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs new file mode 100644 index 0000000..8950458 --- /dev/null +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenGrid.Framework.Data.MySQL +{ + class MySQLInventoryData + { + public MySQLManager database; + + public void Initialise() + { + IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); + string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); + string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); + string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); + string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); + string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); + string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); + + database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); + } + + public string getName() + { + return "MySQL Logdata Interface"; + } + + public void Close() + { + // Do nothing. + } + + public string getVersion() + { + return "0.1"; + } + } +} diff --git a/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs new file mode 100644 index 0000000..628868f --- /dev/null +++ b/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenGrid.Framework.Data +{ + public interface IInventoryData + { + /// + /// Initialises the interface + /// + void Initialise(); + + /// + /// Closes the interface + /// + void Close(); + + /// + /// The plugin being loaded + /// + /// A string containing the plugin name + string getName(); + + /// + /// The plugins version + /// + /// A string containing the plugin version + string getVersion(); + } +} -- cgit v1.1