コード例 #1
0
        static void Main(string[] args)
        {
            "Testing persist engine package".title();

            DBEngine<string, DBElement<string, List<string>>> dbString = new DBEngine<string, DBElement<string, List<string>>>();
            DBElement<string, List<String>> elemString = new DBElement<string, List<String>>();
            elemString.name = "Element2";
            elemString.descr = "testelement2";
            elemString.timeStamp = DateTime.Now;
            elemString.children.AddRange(new List<string> { "SMA1", "Syracuse2", "NY3" });
            elemString.payload = new List<string>();
            elemString.payload.AddRange(new List<string> { "we", "rock", "the ", "world" });

            //elem.showElement();
            dbString.insert("Prohject2", elemString);

            DBElement<string, List<String>> elemString2 = new DBElement<string, List<String>>();
            elemString2.name = "Element3";
            elemString2.descr = "test element3";
            elemString2.timeStamp = DateTime.Now;
            elemString2.children.AddRange(new List<string> { "SMA2", "Syracuse22", "NY33" });
            elemString2.payload = new List<string>();
            elemString2.payload.AddRange(new List<string> { "Thug", "Life" });

            //elem.showElement();
            dbString.insert("Thug3", elemString2);

            PersistEngine<string> test = new PersistEngine<string>();
            test.createXML(dbString);

        }
コード例 #2
0
 void TestR9()
 {
     "\nProject dependancy and realtionships".title();
     WriteLine();
     try
     {
         Console.WriteLine("\nBelow details provide information on dependancy of every package in the project\n");
         pEngineString = new PersistEngine <string, DBElement <string, List <string> > >(dependancyDb);
         pEngineString.displayDependancy();
         dependancyDb.showEnumerableDB();
         WriteLine();
     }
     catch (Exception e)
     {
         WriteLine("\n" + e.Message + "\n");
     }
 }
コード例 #3
0
        void TestR5()
        {
            "Demonstrating Requirement #5".title();
            WriteLine();
            WriteLine("Persisting Database in to the XML\n");
            PersistEngine <string> test = new PersistEngine <string>();       // persisting XML

            test.createXML(dbString);

            "Demonstrating Augmenting back from XML #5".title();

            ReadXml <string> testRead = new ReadXml <string>();

            Console.WriteLine("\nReading the XML\n");                       // reading xml
            testRead.readXml(dbRead);
            WriteLine();
            WriteLine("Displaying DB contents after reading the XML");
            dbRead.showEnumerableDB();
            WriteLine();
        }
コード例 #4
0
        void TestR5()
        {
            WriteLine();
            "\nSave to an XML file".title();
            db.showDB();

            dynamic allKeys = db.Keys();

            pEngine = new PersistEngine <int, DBElement <int, string> >(db);
            pEngine.persistToXML(allKeys);
            WriteLine("\n\nAbove database is stored as XML file in local machine");
            WriteLine();

            WriteLine("\nThe persisted XML file along with new key/value pairs are augmented to the database.\n");
            WriteLine("Below shown key/value pairs are augmented to the database.\n");
            pEngine.augmentDatabaseFromXML(db);                                         //Augment the persisted database along with new values to the main database
            pEngine.persistToXML(allKeys);
            db.showDB();
            WriteLine();
            WriteLine();
        }
コード例 #5
0
        static void Main(string[] args)
        {
            "Testing PersistEngine Package".title('=');
            WriteLine();
            DBEngine <int, DBElement <int, string> > db = new DBEngine <int, DBElement <int, string> >();

            "\nSave to an XML file".title();
            DBElement <int, string> elem1 = new DBElement <int, string>();

            elem1.name      = "Usain Bolt";
            elem1.descr     = "Athelte";
            elem1.timeStamp = DateTime.Now;
            elem1.children.AddRange(new List <int> {
                2
            });
            elem1.payload = "Fastest in the world";
            db.insert(1, elem1);

            DBElement <int, string> elem2 = new DBElement <int, string>();

            elem2.name      = "Saina Nehwal";
            elem2.descr     = "Badminton Player";
            elem2.timeStamp = DateTime.Now;
            elem2.children.AddRange(new List <int> {
                1
            });
            elem2.payload = "Famous badminton player";
            db.insert(2, elem2);
            db.showDB();
            WriteLine();

            dynamic allKeys = db.Keys();
            PersistEngine <int, DBElement <int, string> > pEngine = new PersistEngine <int, DBElement <int, string> >(db);

            pEngine.persistToXML(allKeys);
            WriteLine("\n\nAbove database is stored as XML file in local machine");
            WriteLine();

            WriteLine("\nThe persisted XML file along with new key/value pairs are augmented to the database.\n");
            WriteLine("Below shown key/value pairs are augmented to the database.\n");
            pEngine.augmentDatabaseFromXML(db);                                         //Augment the persisted database along with new values to the main database
            pEngine.persistToXML(allKeys);
            db.showDB();
            WriteLine();
            WriteLine();

            "\nPersist database every 5 seconds until its cancelled".title();
            WriteLine();

            pEngine.scheduledSaveDatabase();
            WriteLine();
            WriteLine();

            "\nProject dependancy and realtionships".title();
            WriteLine();
            DBEngine <string, DBElement <string, List <string> > >      dependancyDb  = new DBEngine <string, DBElement <string, List <string> > >();
            PersistEngine <string, DBElement <string, List <string> > > pEngineString = new PersistEngine <string, DBElement <string, List <string> > >(dependancyDb);

            try
            {
                Console.WriteLine("\nBelow details provide information on dependancy of every package in the project\n");
                pEngine.displayDependancy();
                dependancyDb.showEnumerableDB();
                WriteLine();
            }
            catch (Exception e)
            {
                WriteLine("\n" + e.Message + "\n");
            }
        }
コード例 #6
0
 void TestR9()
 {
     "\nProject dependancy and realtionships".title();
     WriteLine();
     try
     {
         Console.WriteLine("\nBelow details provide information on dependancy of every package in the project\n");
         pEngineString = new PersistEngine<string, DBElement<string, List<string>>>(dependancyDb);
         pEngineString.displayDependancy();
         dependancyDb.showEnumerableDB();
         WriteLine();
     }
     catch (Exception e)
     {
         WriteLine("\n" + e.Message + "\n");
     }
 }
コード例 #7
0
        void TestR5()
        {
            WriteLine();
            "\nSave to an XML file".title();
            db.showDB();

            dynamic allKeys = db.Keys();
            pEngine = new PersistEngine<int, DBElement<int, string>>(db);
            pEngine.persistToXML(allKeys);
            WriteLine("\n\nAbove database is stored as XML file in local machine");
            WriteLine();

            WriteLine("\nThe persisted XML file along with new key/value pairs are augmented to the database.\n");
            WriteLine("Below shown key/value pairs are augmented to the database.\n");
            pEngine.augmentDatabaseFromXML(db);                                         //Augment the persisted database along with new values to the main database
            pEngine.persistToXML(allKeys);
            db.showDB();
            WriteLine();
            WriteLine();
        }
コード例 #8
0
        static void Main(string[] args)
        {
            "Testing PersistEngine Package".title('=');
            WriteLine();
            DBEngine<int, DBElement<int, string>> db = new DBEngine<int, DBElement<int, string>>();
            "\nSave to an XML file".title();
            DBElement<int, string> elem1 = new DBElement<int, string>();
            elem1.name = "Usain Bolt";
            elem1.descr = "Athelte";
            elem1.timeStamp = DateTime.Now;
            elem1.children.AddRange(new List<int> { 2 });
            elem1.payload = "Fastest in the world";
            db.insert(1, elem1);

            DBElement<int, string> elem2 = new DBElement<int, string>();
            elem2.name = "Saina Nehwal";
            elem2.descr = "Badminton Player";
            elem2.timeStamp = DateTime.Now;
            elem2.children.AddRange(new List<int> { 1 });
            elem2.payload = "Famous badminton player";
            db.insert(2, elem2);
            db.showDB();
            WriteLine();

            dynamic allKeys = db.Keys();
            PersistEngine<int,DBElement<int,string>> pEngine = new PersistEngine<int, DBElement<int, string>>(db);
            pEngine.persistToXML(allKeys);
            WriteLine("\n\nAbove database is stored as XML file in local machine");
            WriteLine();

            WriteLine("\nThe persisted XML file along with new key/value pairs are augmented to the database.\n");
            WriteLine("Below shown key/value pairs are augmented to the database.\n");
            pEngine.augmentDatabaseFromXML(db);                                         //Augment the persisted database along with new values to the main database
            pEngine.persistToXML(allKeys);
            db.showDB();
            WriteLine();
            WriteLine();

            "\nPersist database every 5 seconds until its cancelled".title();
            WriteLine();

            pEngine.scheduledSaveDatabase();
            WriteLine();
            WriteLine();

            "\nProject dependancy and realtionships".title();
            WriteLine();
            DBEngine<string, DBElement<string, List<string>>> dependancyDb = new DBEngine<string, DBElement<string, List<string>>>();
            PersistEngine<string, DBElement<string, List<string>>> pEngineString = new PersistEngine<string, DBElement<string, List<string>>>(dependancyDb);
            try
            {
                Console.WriteLine("\nBelow details provide information on dependancy of every package in the project\n");
                pEngine.displayDependancy();
                dependancyDb.showEnumerableDB();
                WriteLine();
            }
            catch (Exception e)
            {
                WriteLine("\n" + e.Message + "\n");
            }
        }