public static ITouchbarElement ConvertToTouchbarElement(this NodeViewModel container) { ITouchbarElement element = null; switch (container.ContainerContent.Type) { case ContainerViewModel.ContainerType.ScrollView: element = new ScrollViewControl(container.ContainerContent.Id) { ChildElements = container.Elements.Select(node => ConvertToButtonElement(node.ElementContent)).ToList() }; break; case ContainerViewModel.ContainerType.Popover: throw new NotImplementedException(); break; case ContainerViewModel.ContainerType.Segmented: element = new SegmentedControl(container.ContainerContent.Id) { ChildElements = container.Elements.Select(node => node.ElementContent.ConvertToSegmentElement()).ToList() }; break; } return(element); }
public void RootTouchbarToXmlAsStringNotNull() { //Arrange var space = new SpecialElement(SpecialElement.Space.Small); var segRoot = new SegmentedControl("4") { Seperated = true }; var seg1 = new SegmentElement("seg1", "a,b,c", "Segment BT 1"); segRoot.ChildElements.Add(seg1); var scroll = new ScrollViewControl("X"); scroll.ChildElements.Add(new ButtonElement("s1", "1,2,3", "Scroll BT1", CustomIcons.GoToIcon)); scroll.ChildElements.Add(new ButtonElement("s2", "ctrl+f", "Scroll BT2") { Width = 80, BackgroundColor = "ff0000" }); scroll.ChildElements.Add(new ButtonElement("s3", "ctrl+f", "Scroll BT3") { Width = 120 }); scroll.ChildElements.Add(new ButtonElement("s4", "ctrl+f", "Scroll BT4") { Width = 80 }); var pop = new PopoverControl("Y", "Pop Items", CustomIcons.SurroundIcon); pop.ChildElements.Add(new ButtonElement("p2", "ctrl+f", "Pop BT1") { Width = 80 }); pop.PressAndHoldChildElements.Add(new ButtonElement("p1", "1,2,3", "PopHold BT1", CustomIcons.FormatDocIcon)); var button3 = new ButtonElement("p3", "alt+f1", "PopHold BT2"); pop.PressAndHoldChildElements.Add(button3); var root = new RootTouchbar(); root.Elements.Add(new ButtonElement("r1", "1,2,3", "Button1", SystemStandardIcons.Play)); root.Elements.Add(space); root.Elements.Add(new ButtonElement("r2", "ctrl+f", "Button2") { Width = 80 }); root.Elements.Add(segRoot); root.Elements.Add(scroll); root.Elements.Add(pop); //Act var doc = root.ToXmlAsString(); //Assert Assert.IsNotNull(doc); Debug.Write(doc); }
// void Update(){ // // if (!listen) // // listen = StartAsClient(); // } public override void OnReceivedBroadcast(string fromAddress, string data) { Debug.Log("Receieve:" + fromAddress + data); // lanDic.Clear(); svc = GameObject.Find("UI Root/Anchor_R/Scroll View").GetComponent <ScrollViewControl>(); string ipv4Add = fromAddress.Substring(7); if (lanDic.ContainsKey(ipv4Add)) { return; } lanDic.Add(ipv4Add, data); svc.addRoom(fromAddress, data); }
internal static OrientedScrollViewerWrapper AsOriented(this ScrollViewControl scrollViewer, Orientation orientation) { return(new OrientedScrollViewerWrapper(scrollViewer, orientation)); }
public OrientedScrollViewerWrapper(ScrollViewControl scrollViewer, Orientation orientation) { ScrollViewer = scrollViewer; Orientation = orientation; }