<commit_before>﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Skybrud.Umbraco.GridData.Json.Converters;

namespace Skybrud.Umbraco.GridData.Values {

    /// <summary>
    /// Class representing the embed value of a control.
    /// </summary>
    [JsonConverter(typeof(GridControlValueStringConverter))]
    public class GridControlEmbedValue : GridControlHtmlValue {
        
        #region Constructors

        /// <summary>
        /// Initializes a new instance based on the specified <paramref name="control"/> and <paramref name="token"/>.
        /// </summary>
        /// <param name="control">An instance of <see cref="GridControl"/> representing the control.</param>
        /// <param name="token">An instance of <see cref="JToken"/> representing the value of the control.</param>
        protected GridControlEmbedValue(GridControl control, JToken token) : base(control, token) { }

        #endregion

        #region Static methods

        /// <summary>
        /// Gets an embed value from the specified <paramref name="control"/> and <paramref name="token"/>.
        /// </summary>
        /// <param name="control">The parent control.</param>
        /// <param name="token">The instance of <code>JToken</code> to be parsed.</param>
        public new static GridControlEmbedValue Parse(GridControl control, JToken token) {
            return token == null ? null : new GridControlEmbedValue(control, token);
        }

        #endregion

    }

}<commit_msg>"GridControlEmbedValue" should implement its own "IsValid" property<commit_after>﻿using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Skybrud.Umbraco.GridData.Json.Converters;

namespace Skybrud.Umbraco.GridData.Values {

    /// <summary>
    /// Class representing the embed value of a control.
    /// </summary>
    [JsonConverter(typeof(GridControlValueStringConverter))]
    public class GridControlEmbedValue : GridControlHtmlValue {

        #region Properties

        public override bool IsValid {
            get { return !String.IsNullOrWhiteSpace(Value); }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance based on the specified <paramref name="control"/> and <paramref name="token"/>.
        /// </summary>
        /// <param name="control">An instance of <see cref="GridControl"/> representing the control.</param>
        /// <param name="token">An instance of <see cref="JToken"/> representing the value of the control.</param>
        protected GridControlEmbedValue(GridControl control, JToken token) : base(control, token) { }

        #endregion

        #region Static methods

        /// <summary>
        /// Gets an embed value from the specified <paramref name="control"/> and <paramref name="token"/>.
        /// </summary>
        /// <param name="control">The parent control.</param>
        /// <param name="token">The instance of <code>JToken</code> to be parsed.</param>
        public new static GridControlEmbedValue Parse(GridControl control, JToken token) {
            return token == null ? null : new GridControlEmbedValue(control, token);
        }

        #endregion

    }

}
{'fraction_non_alphanumeric': 0.12219451371571072, 'fraction_numerical': 0.0, 'mean_word_length': 2.727061556329849, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5998611', 'n_tokens_mistral': 843, 'n_tokens_neox': 816, 'n_words': 246}