public bool ConvertControlValue(Skybrud.Umbraco.GridData.GridControl control, Newtonsoft.Json.Linq.JToken token, out IGridControlValue value)
        {
            value = null;

            value = GridControlLeBlenderValue.Parse(control, token);

            return(value != null);
        }
Beispiel #2
0
        /// <summary>
        /// Converts the specified <paramref name="token" /> into an instance of <see cref="IGridControlValue" />.
        /// </summary>
        /// <param name="control">A reference to the parent <see cref="GridControl" />.</param>
        /// <param name="token">The instance of <see cref="JToken" /> representing the control value.</param>
        /// <param name="value">The converted control value.</param>
        /// <returns></returns>
        public bool ConvertControlValue(GridControl control, JToken token, out IGridControlValue value)
        {
            value = null;
            if (this.isLeBlenderEditor(control.Editor))
            {
                value = GridControlLeBlenderValue.Parse(control);
            }

            return(value != null);
        }
        public GridControlCtaValue(GridControl control) : base(control)
        {
            var blenderCtrl = GridControlLeBlenderValue.Parse(control);

            if (blenderCtrl == null || blenderCtrl.Items == null)
            {
                return;
            }
            var item = blenderCtrl.Items.First();

            Headline = item.GetRawValue("headline");

            Text = item.GetRawValue("text");

            Link = !string.IsNullOrEmpty(item.GetRawValue("link"))
                                ? LinkPickerList.Parse(JObject.Parse(item.GetRawValue("link"))).Items.FirstOrDefault()
                                : null;
        }