public static Available Available(this VCalendar source) { Available AvaObj = null; foreach (var o in source.children().Array.Values) { if (o.Object.GetType() == typeof(Available)) { AvaObj = (Available)o.Object; break; } } return(AvaObj); }
public void testIterate() { var comp = new VCalendar(PhpArray.Empty, false); var sub = comp.createComponent("VEVENT"); comp.add(sub); var sub1 = comp.createComponent("VTODO"); comp.add(sub1); var count = 0; foreach (var compChild in comp.children()) { count++; Assert.IsInstanceOf <Sabre.VObject.Component>(compChild.Value.Object); if (2 == count) { Assert.AreEqual(1, compChild.Key.ToInt()); } } Assert.AreEqual(2, count); }