コード例 #1
0
        protected override object?GetPreValueValue(PreValueDto preValue)
        {
            if (preValue.Alias == "pageSize")
            {
                return(int.TryParse(preValue.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var i) ? (int?)i : null);
            }

            return(preValue.Value?.DetectIsJson() ?? false?JsonConvert.DeserializeObject(preValue.Value) : preValue.Value);
        }
コード例 #2
0
        protected override object?GetPreValueValue(PreValueDto preValue)
        {
            if (preValue.Alias == "hideLabel")
            {
                return(preValue.Value == "1");
            }

            return(preValue.Value?.DetectIsJson() ?? false?JsonConvert.DeserializeObject(preValue.Value) : preValue.Value);
        }
コード例 #3
0
        protected override object GetPreValueValue(PreValueDto preValue)
        {
            if (preValue.Alias == "min" ||
                preValue.Alias == "step" ||
                preValue.Alias == "max")
            {
                return(decimal.TryParse(preValue.Value, out var d) ? (decimal?)d : null);
            }

            return(preValue.Value.DetectIsJson() ? JsonConvert.DeserializeObject(preValue.Value) : preValue.Value);
        }
コード例 #4
0
        // you wish - but MediaPickerConfiguration lives in Umbraco.Web

        /*
         * public override object GetConfiguration(int dataTypeId, string editorAlias, Dictionary<string, PreValueDto> preValues)
         * {
         *  return new MediaPickerConfiguration { ... };
         * }
         */

        protected override object?GetPreValueValue(PreValueDto preValue)
        {
            if (preValue.Alias == "multiPicker" ||
                preValue.Alias == "onlyImages" ||
                preValue.Alias == "disableFolderSelect")
            {
                return(preValue.Value == "1");
            }

            return(base.GetPreValueValue(preValue));
        }
コード例 #5
0
        // you wish - but NestedContentConfiguration lives in Umbraco.Web

        /*
         * public override object GetConfiguration(int dataTypeId, string editorAlias, Dictionary<string, PreValueDto> preValues)
         * {
         *  return new NestedContentConfiguration { ... };
         * }
         */

        protected override object?GetPreValueValue(PreValueDto preValue)
        {
            if (preValue.Alias == "confirmDeletes" ||
                preValue.Alias == "showIcons" ||
                preValue.Alias == "hideLabel")
            {
                return(preValue.Value == "1");
            }

            if (preValue.Alias == "minItems" ||
                preValue.Alias == "maxItems")
            {
                return(int.TryParse(preValue.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var i) ? (int?)i : null);
            }

            return(preValue.Value?.DetectIsJson() ?? false?JsonConvert.DeserializeObject(preValue.Value) : preValue.Value);
        }
コード例 #6
0
 protected virtual object GetPreValueValue(PreValueDto preValue)
 {
     return(preValue.Value.DetectIsJson() ? JsonConvert.DeserializeObject(preValue.Value) : preValue.Value);
 }