public bool ConvertEditorConfig(GridEditor editor, JToken token, out IGridEditorConfig config)
        {
            config = null;

            if (editor.Alias == "richtextBlock")
            {
                config = GridEditorTextConfig.Parse(editor, token as JObject);
            }

            return(config != null);
        }
Exemple #2
0
        /// <summary>
        /// Converts the specified <paramref name="token"/> into an instance of <see cref="IGridEditorConfig"/>.
        /// </summary>
        /// <param name="editor"></param>
        /// <param name="token">The instance of <see cref="JToken"/> representing the editor config.</param>
        /// <param name="config">The converted config.</param>
        public virtual bool ConvertEditorConfig(GridEditor editor, JToken token, out IGridEditorConfig config)
        {
            config = null;

            if (IsMediaEditor(editor))
            {
                config = GridEditorMediaConfig.Parse(editor, token as JObject);
            }
            else if (IsTextStringEditor(editor))
            {
                config = GridEditorTextConfig.Parse(editor, token as JObject);
            }

            return(config != null);
        }
        /// <summary>
        /// Converts the specified <paramref name="token"/> into an instance of <see cref="IGridEditorConfig"/>.
        /// </summary>
        /// <param name="editor"></param>
        /// <param name="token">The instance of <see cref="JToken"/> representing the editor config.</param>
        /// <param name="config">The converted config.</param>
        public virtual bool ConvertEditorConfig(GridEditor editor, JToken token, out IGridEditorConfig config)
        {
            config = null;

            switch (editor.Alias)
            {
            case "media":
                config = GridEditorMediaConfig.Parse(editor, token as JObject);
                break;

            case "headline":
            case "quote":
                config = GridEditorTextConfig.Parse(editor, token as JObject);
                break;
            }

            return(config != null);
        }
        /// <summary>
        /// Converts the specified <paramref name="token"/> into an instance of <see cref="IGridEditorConfig"/>.
        /// </summary>
        /// <param name="editor"></param>
        /// <param name="token">The instance of <see cref="JToken"/> representing the editor config.</param>
        /// <param name="config">The converted config.</param>
        public bool ConvertEditorConfig(GridEditor editor, JToken token, out IGridEditorConfig config)
        {
            config = null;

            switch (editor.Alias)
            {
            case "media_wide":
            case "media_wide_cropped":
                config = GridEditorMediaConfig.Parse(editor, token as JObject);
                break;

            case "banner_headline":
            case "banner_tagline":
            case "headline_centered":
            case "abstract":
            case "paragraph":
            case "quote_D":
            case "code":
                config = GridEditorTextConfig.Parse(editor, token as JObject);
                break;
            }

            return(config != null);
        }