Example #1
0
        /// <summary>
        /// Attempts to return a member based on a user defined umbraco property
        /// </summary>
        /// <param name="binder"></param>
        /// <returns></returns>
        protected virtual Attempt <object> TryGetUserProperty(GetMemberBinder binder)
        {
            var name    = binder.Name;
            var recurse = false;

            if (name.StartsWith("_"))
            {
                name    = name.Substring(1, name.Length - 1);
                recurse = true;
            }

            var value = PublishedContent.GetPropertyValue(name, recurse);

            return(Attempt <object> .SucceedIf(value != null, value));
        }
Example #2
0
 public T GetPropertyValue <T>(string alias, bool recurse, T defaultValue)
 {
     return(PublishedContent.GetPropertyValue(alias, recurse, defaultValue));
 }
Example #3
0
 public T GetPropertyValue <T>(string alias)
 {
     return(PublishedContent.GetPropertyValue <T>(alias));
 }
Example #4
0
 public object GetPropertyValue(string alias, bool recurse, object defaultValue)
 {
     return(PublishedContent.GetPropertyValue(alias, recurse, defaultValue));
 }
Example #5
0
 public object GetPropertyValue(string alias, string defaultValue)
 {
     return(PublishedContent.GetPropertyValue(alias, defaultValue));
 }
Example #6
0
        // for whatever reason, some methods returning strings were created in DynamicPublishedContent
        // and are now considered a "feature" as of v6. So we can't have the proper GetPropertyValue
        // methods returning objects, too. And we don't want to change it in v6 as that would be a
        // breaking change.

#if FIX_GET_PROPERTY_VALUE
        public object GetPropertyValue(string alias)
        {
            return(PublishedContent.GetPropertyValue(alias));
        }