namespace Invercargill { public interface Elements : Enumerable, Sticky { public virtual Enumerable elements_as() { return select_where((e, out r) => e.try_get_as(out r)); } public virtual Enumerable assert_elements_as() { return select(e => e.assert_as()); } } private class ElementsPromotionImplementation : StickyProxyPromotion, Sticky, Elements { protected override Elements adhere (Enumerable enumerable) { return (Elements)new ElementsPromotionImplementation().wrap(enumerable); } protected override Elements passthrough () { return this; } public override bool can_wrap (GLib.Type element_type) { return element_type.is_a (typeof(Element)); } } }