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);
    }
예제 #2
0
        protected override object?GetPreValueValue(PreValueDto preValue)
        {
            if (preValue.Alias == "preview")
            {
                return(preValue.Value == "1");
            }

            return(base.GetPreValueValue(preValue));
        }
예제 #3
0
        protected override object GetPreValueValue(PreValueDto preValue)
        {
            if (preValue.Alias == "showOpenButton" ||
                preValue.Alias == "ignoreUserStartNodes")
            {
                return(preValue.Value == "1");
            }

            return(base.GetPreValueValue(preValue));
        }
    // 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
    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() ?? false?JsonConvert.DeserializeObject(preValue.Value) : preValue.Value);
    }
예제 #6
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);
    }
    // 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);
    }
 protected virtual object?GetPreValueValue(PreValueDto preValue) => preValue.Value?.DetectIsJson() ?? false
     ? JsonConvert.DeserializeObject(preValue.Value)
     : preValue.Value;