Example #1
0
        public void CreateSetsInstance()
        {
            var testList = new Octgn.DataNew.Entities.Game();

            //var ss = StateSave<List<string>>.Create(testList);
            //Assert.AreEqual(testList, ss.GetInstance());
        }
Example #2
0
        public void CreateSetsInstance()
        {
            var testList = new Octgn.DataNew.Entities.Game();

            //var ss = StateSave<List<string>>.Create(testList);
            //Assert.AreEqual(testList, ss.GetInstance());
        }
Example #3
0
 public void GetSetInstanceWorks()
 {
     var testList = new Octgn.DataNew.Entities.Game()
     {
         Name = "Chicken"
     };
     //var ss = StateSave<Octgn.DataNew.Entities.Game>.Create(new Octgn.DataNew.Entities.Game());
     //Assert.AreNotEqual(testList.Name, (ss.GetInstance() as Octgn.DataNew.Entities.Game).Name);
     //ss.SetInstance(testList);
     //Assert.AreEqual(testList,ss.GetInstance());
 }
Example #4
0
 public void GetSetInstanceWorks()
 {
     var testList = new Octgn.DataNew.Entities.Game()
                        {
                            Name = "Chicken"
                        };
     //var ss = StateSave<Octgn.DataNew.Entities.Game>.Create(new Octgn.DataNew.Entities.Game());
     //Assert.AreNotEqual(testList.Name, (ss.GetInstance() as Octgn.DataNew.Entities.Game).Name);
     //ss.SetInstance(testList);
     //Assert.AreEqual(testList,ss.GetInstance());
 }
Example #5
0
        public static void SetGameSetting <T>(DataNew.Entities.Game game, string propName, T val)
        {
            var defSettings = new Hashtable();

            defSettings["name"] = game.Name;
            var settings = SimpleConfig.Get().ReadValue("GameSettings_" + game.Id.ToString(), defSettings);

            if (!settings.ContainsKey(propName))
            {
                settings.Add(propName, val);
            }
            else
            {
                settings[propName] = val;
            }

            SimpleConfig.Get().WriteValue("GameSettings_" + game.Id.ToString(), settings);
        }
Example #6
0
 private void ReloadGameList()
 {
     Dispatcher.Invoke(new Action(() => {
         stackPanel1.Children.Clear();
         var games = GameManager.Get().Games.ToList();
         foreach (GameListItem gs in games
             .OrderBy(x=>x.Name)
             .Select(g => new GameListItem { Game = g }))
         {
             gs.MouseUp += GsMouseUp;
             stackPanel1.Children.Add(gs);
         }
         SelectedGame = null;
         HandleGameSelectedChanged();
     }));
 }
Example #7
0
 private void GsMouseUp(object sender, MouseButtonEventArgs e)
 {
     var gs = (GameListItem)sender;
     SelectedGame = SelectedGame == gs.Game ? null : gs.Game;
     HandleGameSelectedChanged();
 }