<commit_before>﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;

namespace umbraco.uicontrols
{
    public class PropertyPanel : System.Web.UI.WebControls.Panel
    {
        public PropertyPanel()
        {

        }

        private string _text = string.Empty;
        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        protected override void OnLoad(System.EventArgs EventArguments)
        {
        }

        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            this.ViewStateMode = ViewStateMode.Disabled;
            this.CreateChildControls();
            string styleString = "";

            foreach (string key in this.Style.Keys)
            {
                styleString += key + ":" + this.Style[key] + ";";
            }

            var inGroup = this.Parent.GetType() == typeof(PropertyGroup);

            if (string.IsNullOrEmpty(_text))
                CssClass += " hidelabel";

          
            writer.WriteLine("<div class=\"umb-el-wrap " + CssClass + "\">");


            if (_text != string.Empty)
            {
                writer.WriteLine("<label class=\"control-label\" for=\"inputPassword\">" + _text + "</label>");
            }

            writer.WriteLine("<div class=\"controls controls-row\">");

            try
            {
                this.RenderChildren(writer);
            }
            catch (Exception ex)
            {
                writer.WriteLine("Error creating control <br />");
                writer.WriteLine(ex.ToString());
            }

            writer.WriteLine("</div></div>");

        }

    }

}<commit_msg>Manually merges PR: 564<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;

namespace umbraco.uicontrols
{
    public class PropertyPanel : System.Web.UI.WebControls.Panel
    {
        private Control _control;
        private string _text = string.Empty;

        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        protected override void OnLoad(EventArgs eventArguments)
        {
        }

        protected override void Render(HtmlTextWriter writer)
        {
            ViewStateMode = ViewStateMode.Disabled;
            CreateChildControls();


            if (string.IsNullOrEmpty(_text))
                CssClass += " hidelabel";

          
            writer.WriteLine("<div class=\"umb-el-wrap " + CssClass + "\">");


            if (_text != string.Empty)
            {
                if (_control == null)
                {
                    _control = Controls.OfType<Control>().FirstOrDefault(c => c.Visible && (c.GetType().Name.Contains("Literal") == false));
                }

                if (_control == null)
                {
                    writer.WriteLine("<span class=\"control-label\">{0}</span>", _text);
                }
                else
                {
                    writer.WriteLine("<label class=\"control-label\" for=\"{0}\">{1}</label>", _control != null ? _control.ClientID : "", _text);
                }

            }

            writer.WriteLine("<div class=\"controls controls-row\">");

            try
            {
                this.RenderChildren(writer);
            }
            catch (Exception ex)
            {
                writer.WriteLine("Error creating control <br />");
                writer.WriteLine(ex.ToString());
            }

            writer.WriteLine("</div></div>");

        }

    }

}
{'fraction_non_alphanumeric': 0.12182463807702813, 'fraction_numerical': 0.0016388964763725759, 'mean_word_length': 1.4776725304465494, 'pattern_counts': {'":': 1, '<': 20, '<?xml version=': 0, '>': 21, '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': '6329241', 'n_tokens_mistral': 954, 'n_tokens_neox': 901, 'n_words': 179}