private object FindValueOrNull(string name, StringComparison comparison) { if (UnwrappedContents == null || !UnwrappedContents.HasValues) { return(null); } var found = UnwrappedContents.Properties() .FirstOrDefault( p => string.Equals(p.Name, name, comparison)); return(DynamicJacket.WrapOrUnwrap(found?.Value)); }
/// <inheritdoc /> public override object this[int index] => (_propertyArray ?? (_propertyArray = UnwrappedContents.Properties().ToArray()))[index];
/// <summary> /// Enable enumeration. Will return the keys, not the values. <br/> /// Use the [key] accessor to get the values as <see cref="DynamicJacket"/> or <see cref="DynamicJacketList"/> /// </summary> /// <returns>the string names of the keys</returns> public override IEnumerator <object> GetEnumerator() => UnwrappedContents.Properties().Select(p => p.Name).GetEnumerator();