Beispiel #1
0
        // ================================================================================= Overrides

        /// <inheritdoc />
        /// <remarks>Looks for dynamic properties by the given name. If it was not found, continues the search
        /// in the appropriate setting files on the parent chain.</remarks>
        public override object GetProperty(string name)
        {
            if (this.HasProperty(name))
            {
                return(base.GetProperty(name));
            }
            else if (BinaryAsJObject != null)
            {
                bool   found  = false;
                object result = JsonDynamicFieldHelper.GetProperty(BinaryAsJObject, name, out found);

                // If not found, try the inherited settings file
                if (!found)
                {
                    var inherited = this.FindClosestInheritedSettingsFile();
                    if (inherited != null)
                    {
                        return(inherited.GetProperty(name));
                    }
                }
                else
                {
                    AddValueToCache(name, result);
                }

                return(result);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        object GetDynamicProperty(string name)
        {
            if (_dynamicFieldMetadata == null)
            {
                BuildFieldMetadata();
            }

            bool found;

            return(JsonDynamicFieldHelper.GetProperty(_jObject, name, out found));
        }