示例#1
0
 public void TestPenaltyCardButton()
 {
     PenaltyCardButton pb = new PenaltyCardButton ();
     Assert.IsNull (pb.BackgroundColor);
     Assert.IsNull (pb.Name);
     pb.PenaltyCard = new PenaltyCard ("test", Color.Red, CardShape.Circle);
     Assert.AreEqual (pb.Name, "test");
     Assert.AreEqual (pb.BackgroundColor, Color.Red);
     Assert.AreEqual (pb.PenaltyCardEventType, pb.EventType);
 }
 public void TestSerialization()
 {
     DashboardButton db = new DashboardButton ();
     Utils.CheckSerialization (db);
     db = new PenaltyCardButton ();
     Utils.CheckSerialization (db);
     db = new PenaltyCardButton ();
     Utils.CheckSerialization (db);
     db = new ScoreButton ();
     Utils.CheckSerialization (db);
 }
示例#3
0
 public CardObject(PenaltyCardButton card)
     : base(card)
 {
     Button = card;
 }
示例#4
0
        public void AddButton(string buttontype)
        {
            DashboardButton button = null;

            if (buttontype == "Card") {
                button = new PenaltyCardButton {
                    PenaltyCard = new PenaltyCard ("Red", Color.Red, CardShape.Rectangle)
                };
            } else if (buttontype == "Score") {
                button = new ScoreButton {
                    Score = new Score ("Score", 1)
                };
            } else if (buttontype == "Timer") {
                button = new TimerButton { Timer = new Timer { Name = "Timer" } };
            } else if (buttontype == "Tag") {
                button = new TagButton { Tag = new Tag ("Tag", "") };
            } else if (buttontype == "Category") {
                button = template.AddDefaultItem (template.List.Count);
            } else {
                return;
            }

            if (buttontype != "Category") {
                template.List.Add (button);
            }
            button.Position = new Point (template.CanvasWidth, 0);
            edited = true;
            Refresh (button);
        }
示例#5
0
 public void TestSerialization()
 {
     DashboardButton db = new DashboardButton ();
     Utils.CheckSerialization (db);
     db = new TimedDashboardButton ();
     Utils.CheckSerialization (db);
     db = new TagButton ();
     Utils.CheckSerialization (db);
     db = new TimerButton ();
     Utils.CheckSerialization (db);
     db = new EventButton ();
     Utils.CheckSerialization (db);
     db = new AnalysisEventButton ();
     Utils.CheckSerialization (db);
     db = new PenaltyCardButton ();
     Utils.CheckSerialization (db);
     db = new PenaltyCardButton ();
     Utils.CheckSerialization (db);
     db = new ScoreButton ();
     Utils.CheckSerialization (db);
 }