private void Add_Component_Button_Click(object sender, RoutedEventArgs e) { IGuiComponent element = CurrentlyChosenComponent.getNewInstance(); if (gridModifier.AddComponentForCurrentSelection((UIElement)element)) { ElementsCollection.Add(element); } }
public Switcher(ISearchContext searchContext, By @by) : base(searchContext, @by) { Buttons = new ElementsCollection <Button>(Container, x => x.XPath(".//") .AnyTag() .WithAttribute("data-comp-name", "Button") .FixedByKey(), (c, s, e) => new Button(c, s)); }
private void Remove_Component_Button_Click(object sender, RoutedEventArgs e) { try { IGuiComponent removedElement = ElementsCollection.Last <IGuiComponent>(); ElementsCollection.Remove(removedElement); gridModifier.RemoveComponent((UIElement)removedElement); } catch (InvalidOperationException ex) { System.Console.WriteLine("No element on the stack"); } }
void Start() { path = Application.dataPath + "/Resources/Json/elements.json"; jsonString = File.ReadAllText(path); elementsCollection = new ElementsCollection(); elementsCollection = JsonUtility.FromJson <ElementsCollection>(jsonString); //Create Objects for (int i = 0; i < elementsCollection.elements.Length; i++) { GameObject elementDragClone = Instantiate(ElementDrag, transformPanel); GameObject elementFixedClone = Instantiate(ElementFixed, transformTable); elementDragClone.transform.GetChild(0).GetComponent <Text>().text = elementsCollection.elements[i].symbol; elementFixedClone.transform.GetChild(0).GetComponent <Text>().text = elementsCollection.elements[i].atomicNumber.ToString(); elementFixedClone.transform.position = convertStringtoVector3(elementsCollection.elements[i].startPosition); elementFixedClone.name = elementsCollection.elements[i].symbol; } ElementFixed.SetActive(false); ElementDrag.SetActive(false); //Find Element Element element = findByAtomicNumber(1); }
public ElementsController() { Elements = new ElementsCollection(this); BackgroundColor = SKColors.White; }
public Group() { Elements = new ElementsCollection(this); }
public OrderTable(ISearchContext searchContext, By by) : base(searchContext, by) { Items = new ElementsCollection <OrderRow>(Container, x => x.WithTid("Order").FixedByKey(), (sc, selector, we) => new OrderRow(sc, selector)); }
public static void WaitAll <T>(this ElementsCollection <T> collection, Func <T, IProp <bool> > transform) where T : ComponentBase { collection.Wait().All(transform); }
public static void WaitCount <T>(this ElementsCollection <T> collection, int count, string collectionName = "") where T : ComponentBase { var colName = string.IsNullOrEmpty(collectionName) ? "коллекции" : collectionName; collection.Count.Wait($"ожидаем {count} элементов в '{colName}'").EqualTo(count); }