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); } }
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); }
public void ClickFavoriteDashboardButton(string name) { FloatOnDashboardNameButton(name); TimeManager.MediumPause(); if (!IsDashboardFavorited(name)) { DashboardButton FavoriteDashboardButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonDashboardFavorite, name); FavoriteDashboardButton.Click(); } }
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); }
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(); } }
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); }
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(); } }
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(); } }
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(); }
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; } }
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); }
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); }
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 ()); }
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)); } }
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)); } }
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); }
//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; }
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); }
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(); }
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()); }
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); }
public void EmitPressButton(DashboardButton button) { }
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); }
public void ClickDashboardButton(string dsName) { DashboardButton dsButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonHomePageDashboard, dsName); dsButton.Click(); }
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; }
public void ClickDashboardButtonPosition(int positionIndex) { DashboardButton oneDSButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonDashboardPosition, positionIndex); oneDSButton.Click(); }
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); }
public bool IsDashboardButtonPressed(int positionIndex) { DashboardButton oneDSButton = JazzButton.GetOneDashboardButton(JazzControlLocatorKey.ButtonDashboardPosition, positionIndex); return(oneDSButton.IsDashboardPressed()); }