예제 #1
0
        /// <summary>
        /// Method to get the property value by name. Switches to the proper section.
        /// Note this routine supports nested properties and simple arrays and generic List (IList).
        /// </summary>
        /// <param name="property">The property name.</param>
        /// <returns>The property value.</returns>
        public object GetPropertyValue(string property)
        {
            if (!string.IsNullOrEmpty(property))
            {
                string[] parts = property.Split(new[] { '.' }, 2);

                switch (parts[0])
                {
                case "Zipato":
                    return(parts.Length > 1 ? PropertyValue.GetPropertyValue(this, parts[1]) : this);

                case "Data":
                    return(parts.Length > 1 ? PropertyValue.GetPropertyValue(Data, parts[1]) : this.Data);

                default:
                    return(PropertyValue.GetPropertyValue(Data, property));
                }
            }

            return(null);
        }
예제 #2
0
 /// <summary>
 /// Returns the value for the property with the specified name.
 /// </summary>
 /// <param name="property">The property name.</param>
 /// <returns>The property value.</returns>
 public object GetPropertyValue(string property) => PropertyValue.GetPropertyValue(this, property);