Example #1
0
        private void Buy(int i)
        {
            GameFormController gfcntrl   = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
            DialogResult       dlgResult = gfcntrl.Run(this);

            if (dlgResult == DialogResult.OK)
            {
                user.Glib.Add(glibr.Get(i));
                libr.Set(user);
                initializeTabPage2();
            }
        }
        private void Buy(int i)
        {
            GameFormController gfcntrl   = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
            DialogResult       dlgResult = gfcntrl.Run(this);

            if (dlgResult == DialogResult.OK)
            {
                user.Glib.Add(glibr.Get(i));
                libr.Set(user);
                System.Web.Script.Serialization.JavaScriptSerializer oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                File.WriteAllText(@"E:\Registration\Registration\Registration\DataBase.json", "");
                for (int j = 0; j < libr.size(); j++)
                {
                    string sJSON = oSerializer.Serialize(libr.getByIndex(j));
                    sJSON += "\n";
                    File.AppendAllText(@"E:\Registration\Registration\Registration\DataBase.json", sJSON);
                }
                initializeTabPage2();
            }
        }
 public void libraryTestGet2()
 {
     GameLibrary l = new GameLibrary();
     l.Add(new Game("BF3"));
     if (l.Get(0).Name != "BF3")
     {
         Assert.Fail();
     }
 }