protected override void OnElementChanged(ElementChangedEventArgs <Button> e)
 {
     base.OnElementChanged(e);
     if (e?.OldElement == null && e.NewElement != null)
     {
         _button = Control;
         e.NewElement.BorderRadius = 0;
         _dashboardButton          = (DashboardButton)e.NewElement;
         _button.Font = UIFont.SystemFontOfSize((nfloat)_dashboardButton.FontSize, UIFontWeight.Semibold);
     }
 }
Exemple #2
0
        void HandleEditEventSubcategories(DashboardButton dashboardButton)
        {
            AnalysisEventButton button = (dashboardButton as AnalysisEventButton);
            AnalysisEventType   evt    = button.AnalysisEventType;
            EventTypeTagsEditor dialog = new EventTypeTagsEditor(this.Toplevel as Window);

            dialog.EventType = evt;
            dialog.Run();
            dialog.Destroy();
            ViewModel.Model.RemoveDeadLinks(button);
        }
Exemple #3
0
        public void ClickFavoriteDashboardButton(string name)
        {
            FloatOnDashboardNameButton(name);
            TimeManager.MediumPause();

            if (!IsDashboardFavorited(name))
            {
                DashboardButton FavoriteDashboardButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonDashboardFavorite, name);

                FavoriteDashboardButton.Click();
            }
        }
Exemple #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);
        }
Exemple #5
0
        void RemoveButton(DashboardButton button)
        {
            string msg = Catalog.GetString("Do you want to delete: ") +
                         button.Name + "?";

            if (Config.GUIToolkit.QuestionMessage(msg, null, this))
            {
                template.RemoveButton(button);
                Edited = true;
                Refresh();
            }
        }
Exemple #6
0
        ActionLink CreateActionLink(DashboardButton source, DashboardButton dest, Tag sourceTag, Tag destTag)
        {
            ActionLink link = CreateActionLink(source, dest);

            link.SourceTags = new RangeObservableCollection <Tag> {
                sourceTag
            };
            link.DestinationTags = new RangeObservableCollection <Tag> {
                destTag
            };
            return(link);
        }
Exemple #7
0
        public void Click(DashboardButton b, Tag tag = null)
        {
            DashboardButtonObject co = Objects.OfType <DashboardButtonObject> ().FirstOrDefault(o => o.Button == b);

            if (tag != null && co is CategoryObject)
            {
                (co as CategoryObject).ClickTag(tag);
            }
            else
            {
                co.Click();
            }
        }
Exemple #8
0
        public void Click(DashboardButton b, TagVM tag = null)
        {
            DashboardButtonView co = Objects.OfType <DashboardButtonView> ().FirstOrDefault(o => o.Button == b);

            if (tag != null && co is AnalysisEventButtonView)
            {
                (co as AnalysisEventButtonView).ClickTag(tag);
            }
            else
            {
                co.Click();
            }
        }
Exemple #9
0
        void EditEventSubcategories(DashboardButton dashboardButton)
        {
            AnalysisEventButton button = (dashboardButton as AnalysisEventButton);
            AnalysisEventType   evt    = button.AnalysisEventType;
            EventTypeTagsEditor dialog = new EventTypeTagsEditor(this.Toplevel as Window);

            dialog.EventType = evt;
            dialog.Run();
            dialog.Destroy();
            template.RemoveDeadLinks(button);
            Edited = true;
            Refresh();
        }
Exemple #10
0
 void HandleTaggersSelectedEvent(List <DashboardButton> taggers)
 {
     if (taggers.Count == 1)
     {
         selected                = taggers [0];
         tagproperties.Tagger    = taggers [0];
         propertiesnotebook.Page = PROPERTIES_NOTEBOOK_PAGE_TAGS;
     }
     else
     {
         selected                = null;
         tagproperties.Tagger    = null;
         propertiesnotebook.Page = PROPERTIES_NOTEBOOK_PAGE_EMPTY;
     }
 }
Exemple #11
0
        protected override void StopMove(bool moved)
        {
            Selection sel = Selections.FirstOrDefault();

            if (movingLink != null)
            {
                if (destAnchor != null)
                {
                    ActionLinkVM link = movingLink.Link;
                    link.DestinationButton = destAnchor.Button.ButtonVM;
                    link.DestinationTags.ViewModels.AddRange(destAnchor.Tags);
                    link.SourceButton.ActionLinks.ViewModels.Add(link);
                    movingLink.Destination = destAnchor;
                    destAnchor.Highlighted = false;
                    if (ActionLinkCreatedEvent != null)
                    {
                        ActionLinkCreatedEvent(link);
                    }
                    linksDict.Add(link, movingLink);
                }
                else
                {
                    RemoveObject(movingLink);
                    widget.ReDraw();
                }
                ClearSelection();
                movingLink = null;
                destAnchor = null;
                return;
            }

            if (sel != null && moved)
            {
                if (sel.Drawable is DashboardButtonView)
                {
                    /* Round the position of the button to match a corner in the grid */
                    int             i  = VASDrawing.Constants.CATEGORY_TPL_GRID;
                    DashboardButton tb = (sel.Drawable as DashboardButtonView).Button;
                    tb.Position.X = VASDrawing.Utils.Round(tb.Position.X, i);
                    tb.Position.Y = VASDrawing.Utils.Round(tb.Position.Y, i);
                    tb.Width      = (int)VASDrawing.Utils.Round(tb.Width, i);
                    tb.Height     = (int)VASDrawing.Utils.Round(tb.Height, i);
                    (sel.Drawable as DashboardButtonView).ResetDrawArea();
                    widget.ReDraw();
                }
            }
            base.StopMove(moved);
        }
Exemple #12
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);
        }
Exemple #13
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);
        }
        public void TestCircularDepdencies()
        {
            DashboardLongoMatch dashboard = new DashboardLongoMatch ();
            DashboardButton b1 = new DashboardButton ();
            DashboardButton b2 = new DashboardButton ();
            DashboardButton b3 = new DashboardButton ();
            dashboard.List.Add (b1);
            dashboard.List.Add (b2);
            dashboard.List.Add (b3);

            b1.AddActionLink (new ActionLink { DestinationButton = b2 });
            Assert.IsFalse (dashboard.HasCircularDependencies ());
            b2.AddActionLink (new ActionLink { DestinationButton = b3 });
            Assert.IsFalse (dashboard.HasCircularDependencies ());
            b3.AddActionLink (new ActionLink { DestinationButton = b1 });
            Assert.IsTrue (dashboard.HasCircularDependencies ());
        }
Exemple #15
0
        public void Refresh(DashboardButton b = null)
        {
            DashboardButtonView to;

            if (ViewModel == null)
            {
                return;
            }
            ClearCanvas();
            FillCanvas();
            to = Objects.OfType <DashboardButtonView> ().
                 FirstOrDefault(o => o.Button == b);
            if (to != null)
            {
                UpdateSelection(new Selection(to, SelectionPosition.All, 0));
            }
        }
Exemple #16
0
        public void Refresh(DashboardButton b = null)
        {
            DashboardButtonObject to;

            if (Template == null)
            {
                return;
            }

            LoadTemplate();
            to = Objects.OfType <DashboardButtonObject> ().
                 FirstOrDefault(o => o.Button == b);
            if (to != null)
            {
                UpdateSelection(new Selection(to, SelectionPosition.All, 0));
            }
        }
Exemple #17
0
        protected virtual DashboardButton CreateButton(string buttonType)
        {
            DashboardButton button = null;

            if (buttonType == "Tag")
            {
                button = new TagButton {
                    Tag = new Tag("Tag", "")
                };
            }
            else if (buttonType == "Category")
            {
                button = ViewModel.Model.CreateDefaultItem(ViewModel.Model.List.Count);
            }

            return(button);
        }
Exemple #18
0
        //GAL start
        private void InitializeDashboard()
        {
            receiverUI1 = new ReceiverUI();
            receiverUI2 = new ReceiverUI();
            receiverUI3 = new ReceiverUI();
            receiverUI4 = new ReceiverUI();

            ARFCN1 = new UnitView();
            ARFCN2 = new UnitView();
            ARFCN3 = new UnitView();
            ARFCN4 = new UnitView();

            SetReceiverUI(receiverUI1, 1);
            SetReceiverUI(receiverUI2, 2);
            SetReceiverUI(receiverUI3, 3);
            SetReceiverUI(receiverUI4, 4);

            BrushConverter conv = new BrushConverter();

            dashboardButtonFiles = new DashboardButton();
            FilesInfo filesButton = new FilesInfo();

            SetDashboardButton("#ffea6c41", filesButton.ItemName, filesButton.Count, PackIconMaterialKind.File, dashboardButtonFiles);

            dashboardButtonRecordFiles = new DashboardButton();
            RecordsInfo recordsButton = new RecordsInfo();

            SetDashboardButton("#ffe69a2a", recordsButton.ItemName, recordsButton.Count, PackIconMaterialKind.RecordRec, dashboardButtonRecordFiles);

            dashboardButtonPhoneCalls = new DashboardButton();
            CallsInfo callButton = new CallsInfo();

            SetDashboardButton("#FF469408", callButton.ItemName, callButton.Count, PackIconMaterialKind.PhoneLog, dashboardButtonPhoneCalls);

            dashboardButtonSmsMessages = new DashboardButton();
            SmsInfo smsButton = new SmsInfo();

            SetDashboardButton("#FF177EC1", smsButton.ItemName, smsButton.Count, PackIconMaterialKind.EmailOpen, dashboardButtonSmsMessages);


            Units     = TransferDB.Units;
            computers = TransferDB.Computers;
        }
Exemple #19
0
        public void HandleNewDashboardEvent(TimelineEvent play, DashboardButton btn, bool edit, List <DashboardButton> from)
        {
            if (openedProject == null)
            {
                return;
            }

            if (projectType == ProjectType.CaptureProject ||
                projectType == ProjectType.URICaptureProject ||
                projectType == ProjectType.FakeCaptureProject)
            {
                if (!capturer.Capturing)
                {
                    guiToolkit.WarningMessage(Catalog.GetString("Video capture is stopped"));
                    return;
                }
            }

            if (!openedProject.Dashboard.DisablePopupWindow && edit)
            {
                if (projectType == ProjectType.FileProject)
                {
                    bool playing = player.Playing;
                    player.Pause();
                    Config.GUIToolkit.EditPlay(play, openedProject, true, true, true, true);
                    if (playing)
                    {
                        player.Play();
                    }
                }
                else
                {
                    Config.GUIToolkit.EditPlay(play, openedProject, true, true, true, true);
                }
            }

            Log.Debug(String.Format("New play created start:{0} stop:{1} category:{2}",
                                    play.Start.ToMSecondsString(), play.Stop.ToMSecondsString(),
                                    play.EventType.Name));
            openedProject.AddEvent(play);
            AddNewPlay(play);
        }
Exemple #20
0
        partial void DownloadButtonClicked(UIButton sender)
        {
            if (currentActiveView == 2)
            {
                return;
            }
            BluetoothViewObj.Hidden = true;
            DownloadViewObj.Hidden  = false;

            // Make the current button bold and stand out
            DownloadButton.SetTitleColor(UIColor.FromRGBA(82, 99, 227, 255), UIControlState.Normal);
            DownloadButton.Font = UIFont.BoldSystemFontOfSize(17.0f);

            // Make other fonts smaller
            DashboardButton.Font = UIFont.SystemFontOfSize(17.0f);
            BluetoothButton.Font = UIFont.SystemFontOfSize(17.0f);
            DashboardButton.SetTitleColor(UIColor.FromRGBA(82, 99, 227, 175), UIControlState.Normal);
            BluetoothButton.SetTitleColor(UIColor.FromRGBA(82, 99, 227, 175), UIControlState.Normal);
            currentActiveView = 2;
        }
        public void NavigateToDashboard()
        {
            DashboardButton.Click();
            ProjectButton.Click();
            string Test = Header.Text.ToString();

            Assert.IsTrue(Test.Contains("VideoGames"));
            TemplateButton.Click();

            dropdown.Click();
            for (int i = 0; i < DropdownItems.Count; i++)
            {
                if (DropdownItems[i].Text.Contains("Force"))
                {
                    string me = DropdownItems[i].Text.ToString();
                    DropdownItems[i].Click();
                    unlockSubmit.Click();
                }
            }
            TempButton.Click();
        }
Exemple #22
0
        public void TestCircularDepdencies()
        {
            Utils.DashboardDummy dashboard = new Utils.DashboardDummy();
            DashboardButton      b1        = new DashboardButton();
            DashboardButton      b2        = new DashboardButton();
            DashboardButton      b3        = new DashboardButton();

            dashboard.List.Add(b1);
            dashboard.List.Add(b2);
            dashboard.List.Add(b3);

            b1.AddActionLink(new ActionLink {
                DestinationButton = b2
            });
            Assert.IsFalse(dashboard.HasCircularDependencies());
            b2.AddActionLink(new ActionLink {
                DestinationButton = b3
            });
            Assert.IsFalse(dashboard.HasCircularDependencies());
            b3.AddActionLink(new ActionLink {
                DestinationButton = b1
            });
            Assert.IsTrue(dashboard.HasCircularDependencies());
        }
Exemple #23
0
        public bool IsShareDashboardUnread(string dsName)
        {
            DashboardButton dsButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonHomePageDashboard, dsName);

            return(dsButton.IsDashboardUnread());
        }
 public void ClickButton(DashboardButton button, Tag tag = null)
 {
     codingwidget.ClickButton(button, tag);
 }
Exemple #25
0
 public void EmitPressButton(DashboardButton button)
 {
 }
Exemple #26
0
        void HandleNewTagEvent(EventType eventType, List <Player> players, TeamType team, List <Tag> tags,
                               Time start, Time stop, Time eventTime, Score score, PenaltyCard card, DashboardButton btn)
        {
            TimelineEvent play = project.AddEvent(eventType, start, stop, eventTime, null, score, card, false);

            play.Team    = teamtagger.SelectedTeam;
            play.Players = selectedPlayers ?? new List <Player> ();
            play.Tags    = tags ?? new List <Tag> ();
            teamtagger.ResetSelection();
            selectedPlayers = null;
            Config.EventsBroker.EmitNewDashboardEvent(play, btn, true, null);
        }
Exemple #27
0
        public void ClickDashboardButton(string dsName)
        {
            DashboardButton dsButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonHomePageDashboard, dsName);

            dsButton.Click();
        }
Exemple #28
0
        public void TestIsChanged()
        {
            DashboardButton db = new DashboardButton();

            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;
            db.Name      = "name";
            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;
            db.ActionLinks.Add(new ActionLink());
            Assert.IsTrue(db.IsChanged);
            db.IsChanged   = false;
            db.ActionLinks = null;
            Assert.IsTrue(db.IsChanged);
            db.IsChanged       = false;
            db.BackgroundColor = Color.Black;
            Assert.IsTrue(db.IsChanged);
            db.IsChanged       = false;
            db.BackgroundImage = new Image(5, 5);
            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;
            db.Height    = 100;
            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;
            db.HotKey    = new HotKey {
                Key = 3
            };
            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;
            db.Position  = new Point(1, 2);
            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;
            db.TextColor = Color.Green;
            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;
            db.Width     = 200;
            Assert.IsTrue(db.IsChanged);
            db.IsChanged = false;

            var tb = new TimedDashboardButton();

            Assert.IsTrue(tb.IsChanged);
            tb.IsChanged = false;
            tb.TagMode   = TagMode.Free;
            Assert.IsTrue(tb.IsChanged);
            tb.IsChanged = false;
            tb.Start     = new Time(29);
            Assert.IsTrue(tb.IsChanged);
            tb.IsChanged = false;
            tb.Stop      = new Time(29);
            Assert.IsTrue(tb.IsChanged);
            tb.IsChanged = false;

            var tgb = new TagButton();

            Assert.IsTrue(tgb.IsChanged);
            tgb.IsChanged = false;
            tgb.Tag       = new Tag("test");
            Assert.IsTrue(tgb.IsChanged);
            tgb.IsChanged = false;

            var eb = new EventButton();

            Assert.IsTrue(eb.IsChanged);
            eb.IsChanged = false;
            eb.EventType = new EventType();
            Assert.IsTrue(eb.IsChanged);
            eb.IsChanged = false;

            var aeb = new AnalysisEventButton();

            Assert.IsTrue(aeb.IsChanged);
            aeb.IsChanged         = false;
            aeb.ShowSubcategories = false;
            Assert.IsTrue(aeb.IsChanged);
            aeb.IsChanged  = false;
            aeb.TagsPerRow = 4;
            Assert.IsTrue(aeb.IsChanged);
            aeb.IsChanged = false;
        }
Exemple #29
0
        public void ClickDashboardButtonPosition(int positionIndex)
        {
            DashboardButton oneDSButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonDashboardPosition, positionIndex);

            oneDSButton.Click();
        }
Exemple #30
0
        public bool IsDashboardFavorited(string name)
        {
            DashboardButton FavoriteDashboardButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonDashboardFavorite, name);

            return(FavoriteDashboardButton.IsDashboardFavorited());
        }
        public void TestRemoveButton()
        {
            DashboardLongoMatch dashboard = new DashboardLongoMatch ();
            DashboardButton b1 = new DashboardButton ();
            DashboardButton b2 = new DashboardButton ();
            DashboardButton b3 = new DashboardButton ();
            dashboard.List.Add (b1);
            dashboard.List.Add (b2);
            dashboard.List.Add (b3);

            b1.ActionLinks.Add (new ActionLink { DestinationButton = b2 });
            b2.ActionLinks.Add (new ActionLink { DestinationButton = b3 });
            b3.ActionLinks.Add (new ActionLink { DestinationButton = b1 });

            dashboard.RemoveButton (b3);
            Assert.AreEqual (0, b2.ActionLinks.Count);
            dashboard.RemoveButton (b2);
            Assert.AreEqual (0, b1.ActionLinks.Count);
        }
Exemple #32
0
        public bool IsDashboardButtonPressed(int positionIndex)
        {
            DashboardButton oneDSButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonDashboardPosition, positionIndex);

            return(oneDSButton.IsDashboardPressed());
        }