Inheritance: DashboardButton
 public void TestIsChanged()
 {
     var tib = new TimerButton ();
     Assert.IsTrue (tib.IsChanged);
     tib.IsChanged = false;
     tib.Timer = new TimerLongoMatch ();
     Assert.IsTrue (tib.IsChanged);
     tib.IsChanged = false;
 }
Example #2
0
 public TimerObject(TimerButton timer)
     : base(timer)
 {
     Button = timer;
     Toggle = true;
     CurrentTime = new Time (0);
     if (iconImage == null) {
         iconImage = new Image (Path.Combine (Config.ImagesDir,
             StyleConf.ButtonTimerIcon));
     }
     if (cancelImage == null) {
         cancelImage = new Image (Path.Combine (Config.IconsDir,
             StyleConf.CancelButton));
     }
     MinWidth = StyleConf.ButtonMinWidth;
     MinHeight = iconImage.Height + StyleConf.ButtonTimerFontSize;
     cancelRect = new Rectangle ();
 }
Example #3
0
 public void EmitTimeNodeStoppedEvent(TimeNode node, TimerButton btn, List<DashboardButton> from)
 {
     if (TimeNodeStoppedEvent != null) {
         if (from == null)
             from = new List<DashboardButton> ();
         TimeNodeStoppedEvent (node, btn, from);
     }
 }
Example #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);
        }
Example #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);
 }
Example #6
0
 public void TestTimerButton()
 {
     TimerButton tm = new TimerButton ();
     Assert.IsNull (tm.Name);
     tm.Timer = new Timer {Name = "test"};
     Assert.AreEqual (tm.Name, "test");
     tm.Name = "test2";
     Assert.AreEqual (tm.Timer.Name, "test2");
 }