Наследование: EventButton
Пример #1
0
 public ScoreObject(ScoreButton score)
     : base(score)
 {
     ScoreButton = score;
     if (iconImage == null) {
         iconImage = Resources.LoadImage (StyleConf.ButtonScoreIcon);
     }
 }
Пример #2
0
 public void TestScoreButton()
 {
     ScoreButton sb = new ScoreButton ();
     Assert.IsNull (sb.Score);
     sb.Score = new Score ("test", 2);
     Assert.AreEqual (sb.Name, "test");
     Assert.AreEqual (sb.BackgroundColor, sb.EventType.Color);
     Assert.AreEqual (sb.ScoreEventType, sb.EventType);
 }
Пример #3
0
 public ScoreObject(ScoreButton score)
     : base(score)
 {
     Button = score;
     if (iconImage == null) {
         iconImage = new Image (System.IO.Path.Combine (Config.ImagesDir,
             StyleConf.ButtonScoreIcon));
     }
 }
Пример #4
0
 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);
 }
Пример #5
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);
        }
Пример #6
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);
 }