public override IEnumerable <DataBinding> GetBindingsForInformalDescription() { foreach (DataBinding dataBinding in item.GetBindingsForInformalDescription()) { yield return(source.ReverseTranslateBinding(dataBinding)); } }
private static object Bind(IDataAccessor accessor, IDataItem bindingItem, IFormatter formatter) { try { return(accessor.GetValue(bindingItem)); } catch (DataBindingException ex) { using (TestLog.Failures.BeginSection("Data binding failure")) { if (!string.IsNullOrEmpty(ex.Message)) { TestLog.Failures.WriteLine(ex.Message); } bool first = true; foreach (DataBinding binding in bindingItem.GetBindingsForInformalDescription()) { if (first) { TestLog.Failures.Write("\nAvailable data bindings for this item:\n\n"); first = false; } using (TestLog.Failures.BeginMarker(Marker.Label)) { TestLog.Failures.Write(binding); TestLog.Failures.Write(": "); } TestLog.Failures.WriteLine(bindingItem.GetValue(binding)); } if (first) { TestLog.Failures.Write("\nThis item does not appear to provide any data bindings.\n"); } } throw new SilentTestException(TestOutcome.Error); } }
private static object Bind(IDataAccessor accessor, IDataItem bindingItem, IFormatter formatter) { try { return accessor.GetValue(bindingItem); } catch (DataBindingException ex) { using (TestLog.Failures.BeginSection("Data binding failure")) { if (!string.IsNullOrEmpty(ex.Message)) TestLog.Failures.WriteLine(ex.Message); bool first = true; foreach (DataBinding binding in bindingItem.GetBindingsForInformalDescription()) { if (first) { TestLog.Failures.Write("\nAvailable data bindings for this item:\n\n"); first = false; } using (TestLog.Failures.BeginMarker(Marker.Label)) { TestLog.Failures.Write(binding); TestLog.Failures.Write(": "); } TestLog.Failures.WriteLine(bindingItem.GetValue(binding)); } if (first) TestLog.Failures.Write("\nThis item does not appear to provide any data bindings.\n"); } throw new SilentTestException(TestOutcome.Error); } }