/// <summary>
        /// Attempts to convert the value specified into a useable value on the front-end
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public Attempt<object> ConvertPropertyValue(object value)
        {
            if (UmbracoContext.Current != null && value != null && value.ToString().Length > 0)
            {
                var imagePoint = new DataTypes.ImagePoint.ImagePoint();

                // use the uQuery.IGetProperty interface to do the work
                ((uQuery.IGetProperty)imagePoint).LoadPropertyValue(value.ToString());

                return new Attempt<object>(true, imagePoint);
            }

            return Attempt<object>.False;
        }
Exemple #2
0
        /// <summary>
        /// Attempts to convert the value specified into a useable value on the front-end
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public Attempt <object> ConvertPropertyValue(object value)
        {
            if (UmbracoContext.Current != null && value != null && value.ToString().Length > 0)
            {
                var imagePoint = new DataTypes.ImagePoint.ImagePoint();

                // use the uQuery.IGetProperty interface to do the work
                ((uQuery.IGetProperty)imagePoint).LoadPropertyValue(value.ToString());

                return(new Attempt <object>(true, imagePoint));
            }

            return(Attempt <object> .False);
        }
        /// <summary>
        /// Initializes the specified current node unique identifier.
        /// </summary>
        /// <param name="CurrentNodeId">The current node unique identifier.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            // if model binding is disbaled, return a DynamicXml object
            if (!Settings.RazorModelBindingEnabled)
            {
            #pragma warning disable 0618
                instance = new DynamicXml(PropertyData);
            #pragma warning restore 0618
                return true;
            }

            DataTypes.ImagePoint.ImagePoint imagePoint = new DataTypes.ImagePoint.ImagePoint();

            // use the uQuery IGetProperty interface to do the work
            ((uQuery.IGetProperty)imagePoint).LoadPropertyValue(PropertyData);

            instance = imagePoint;
            return true;
        }
        /// <summary>
        /// Initializes the specified current node unique identifier.
        /// </summary>
        /// <param name="CurrentNodeId">The current node unique identifier.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            // if model binding is disbaled, return a DynamicXml object
            if (!Settings.RazorModelBindingEnabled)
            {
#pragma warning disable 0618
                instance = new DynamicXml(PropertyData);
#pragma warning restore 0618
                return(true);
            }

            DataTypes.ImagePoint.ImagePoint imagePoint = new DataTypes.ImagePoint.ImagePoint();

            // use the uQuery IGetProperty interface to do the work
            ((uQuery.IGetProperty)imagePoint).LoadPropertyValue(PropertyData);

            instance = imagePoint;
            return(true);
        }