public async Task NotifyMultiSelectedAsync(bool[] selected) { var selectedIndexes = Enumerable.Range(0, selected.Length).Where(i => selected[i]); ComponentValue = ItemsArray.Where((item, index) => selectedIndexes.Contains(index)).Select(x => x.SelectedValue).ToArray(); await Task.CompletedTask; }
static void Main(string[] args) { var array = new ItemsArray { Items = new BaseItem[] { new ItemA { Value = true, Text = "Test" }, new ItemB { Value = false, Number = 7 } } }; ItemsArray output; using (var stream = new MemoryStream()) { var serializer = new XmlSerializer(typeof(ItemsArray)); serializer.Serialize(stream, array); stream.Position = 0; output = (ItemsArray)serializer.Deserialize(stream); } }
public void Queue_should_return_comparable_objects_in_sorted_order() { var input = ItemsArray.FromIntArray(new [] { 4, 2, 1, 3 }); var result = PutIntoQueueAndTakeBack(input); result.Should() .BeInAscendingOrder() .And.BeEquivalentTo <Item>(ItemsArray.FromIntArray(new[] { 1, 2, 3, 4 })); }
public STLItemAvailable(string APIKey, string ItemNumber) { GetItemAvailable gia = new GetItemAvailable(); ItemsArray ia = gia.CallGetItemAvailable(APIKey, ItemNumber); XmlElement[] XEArray = ia.Any; XmlNode n = XEArray[0]; int testn = 0; DateTime testd; foreach (XmlNode xn in n.ChildNodes) { switch (xn.Name) { case "item_id": this._itemNumber = xn.InnerText; break; case "tn_onhand": int.TryParse(xn.InnerText, out testn); this._tnOnHand = testn; break; case "tn_onorder": int.TryParse(xn.InnerText, out testn); this._tnOnOrder = testn; break; case "tn_onorder_eta": DateTime.TryParse(xn.InnerText, out testd); this._tnOrderETA = testd; break; case "nv_onhand": int.TryParse(xn.InnerText, out testn); this._nvOnHand = testn; break; case "nv_onorder": int.TryParse(xn.InnerText, out testn); this._nvOnOrder = testn; break; case "nv_onorder_eta": DateTime.TryParse(xn.InnerText, out testd); this._nvOrderETA = testd; break;
public void NotifyMultiSelected(int[] selectedIndexes) { //var selectedIndexes = Enumerable.Range(0, selected.Length).Where(i => selected[i]); ComponentValue = ItemsArray.Where((item, index) => selectedIndexes.Contains(index)).Select(x => x.SelectedValue).ToArray(); }