From f95b6081cba084d1b067acea99c0effa2b3bf42c Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 24 May 2007 12:35:32 +0000 Subject: Renamed the new Directories. (removed the "-Source" from the end of them) --- .../OpenGrid.Framework.Data.DB4o/DB4oManager.cs | 110 --------------------- 1 file changed, 110 deletions(-) delete mode 100644 OpenGridServices-Source/OpenGrid.Framework.Data.DB4o/DB4oManager.cs (limited to 'OpenGridServices-Source/OpenGrid.Framework.Data.DB4o/DB4oManager.cs') diff --git a/OpenGridServices-Source/OpenGrid.Framework.Data.DB4o/DB4oManager.cs b/OpenGridServices-Source/OpenGrid.Framework.Data.DB4o/DB4oManager.cs deleted file mode 100644 index aaa6e91..0000000 --- a/OpenGridServices-Source/OpenGrid.Framework.Data.DB4o/DB4oManager.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Db4objects.Db4o; -using OpenGrid.Framework.Data; -using libsecondlife; - -namespace OpenGrid.Framework.Data.DB4o -{ - class DB4oGridManager - { - public Dictionary simProfiles = new Dictionary(); - string dbfl; - - public DB4oGridManager(string db4odb) - { - dbfl = db4odb; - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - IObjectSet result = database.Get(typeof(SimProfileData)); - foreach(SimProfileData row in result) { - simProfiles.Add(row.UUID, row); - } - database.Close(); - } - - /// - /// Adds a new profile to the database (Warning: Probably slow.) - /// - /// The profile to add - /// Successful? - public bool AddRow(SimProfileData row) - { - if (simProfiles.ContainsKey(row.UUID)) - { - simProfiles[row.UUID] = row; - } - else - { - simProfiles.Add(row.UUID, row); - } - - try - { - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - database.Set(row); - database.Close(); - return true; - } - catch (Exception e) - { - return false; - } - } - - - } - - class DB4oUserManager - { - public Dictionary userProfiles = new Dictionary(); - string dbfl; - - public DB4oUserManager(string db4odb) - { - dbfl = db4odb; - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - IObjectSet result = database.Get(typeof(UserProfileData)); - foreach (UserProfileData row in result) - { - userProfiles.Add(row.UUID, row); - } - database.Close(); - } - - /// - /// Adds a new profile to the database (Warning: Probably slow.) - /// - /// The profile to add - /// Successful? - public bool AddRow(UserProfileData row) - { - if (userProfiles.ContainsKey(row.UUID)) - { - userProfiles[row.UUID] = row; - } - else - { - userProfiles.Add(row.UUID, row); - } - - try - { - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - database.Set(row); - database.Close(); - return true; - } - catch (Exception e) - { - return false; - } - } - - - } -} -- cgit v1.1