Пример #1
0
        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));
        }
Пример #2
0
 /// <inheritdoc />
 public override object this[int index] => (_propertyArray ?? (_propertyArray = UnwrappedContents.Properties().ToArray()))[index];
Пример #3
0
 /// <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();