<commit_before>﻿using Acme.Helpers.Core.Extensions;
using Microsoft.AspNet.Mvc.ModelBinding;
using System.Diagnostics;

namespace Acme.Helpers.TagHelpers
{
    [DebuggerDisplayAttribute("{Id}")]
    internal class TableColumn
    {
        public string Id { get; set; }
        public string For { get; set; }
        public string Title { get; set; }
        public string Style { get; set; }
        public string Width { get; set; }
        public string CellDisplayFormat { get; set; }
        public string CellNullDisplayText { get; set; }
        public string CellUihint { get; set; }
        public bool CellVisible { get; set; }
        public string CellContent { get; set; }

        public TableColumn()
        {
            CellVisible = true;
        }

        public TableColumn(ModelMetadata meta)
            : this()
        {
            Id = meta.PropertyName;
            For = meta.PropertyName;
            Title = meta.DisplayName ?? meta.PropertyName.SplitCamelCase();

            CellDisplayFormat = meta.DisplayFormatString;
            CellNullDisplayText = meta.NullDisplayText;
            CellUihint = meta.TemplateHint;
            CellVisible = !meta.HideSurroundingHtml;
        }

        public TableColumn(ISupportTableHeader th)
            : this()
        {
            Id = th.HeaderId ?? th.AspFor;
            For = th.AspFor;
            Title = th.HeaderTitle ?? Id.SplitCamelCase();
            Style = th.Style;
            Width = th.Width;

            CellDisplayFormat = th.CellDisplayFormat;
            CellNullDisplayText = th.CellNullDisplayText;
            CellUihint = th.CellUihint;<commit_msg>Add ability to set or change the order of columns in markup<commit_after>﻿using Acme.Helpers.Core.Extensions;
using Microsoft.AspNet.Mvc.ModelBinding;
using System.Diagnostics;

namespace Acme.Helpers.TagHelpers
{
    [DebuggerDisplayAttribute("{Id}")]
    internal class TableColumn
    {
        public string Id { get; set; }
        public string For { get; set; }
        public int Order { get; set; }
        public string Title { get; set; }
        public string Style { get; set; }
        public string Width { get; set; }
        public string CellContent { get; set; }
        public string CellDisplayFormat { get; set; }
        public string CellNullDisplayText { get; set; }
        public string CellUihint { get; set; }
        public bool CellVisible { get; set; }

        public TableColumn()
        {
            CellVisible = true;
        }

        public TableColumn(ModelMetadata meta)
            : this()
        {
            Id = meta.PropertyName;
            For = meta.PropertyName;
            Order = meta.Order;
            Title = meta.DisplayName ?? meta.PropertyName.SplitCamelCase();

            CellDisplayFormat = meta.DisplayFormatString;
            CellNullDisplayText = meta.NullDisplayText;
            CellUihint = meta.TemplateHint;
            CellVisible = !meta.HideSurroundingHtml;
        }

        public TableColumn(ISupportTableHeader th)
            : this()
        {
            Id = th.HeaderId ?? th.AspFor;
            For = th.AspFor;
            Order = th.HeaderOrder;
            Title = th.HeaderTitle ?? Id.SplitCamelCase();
            Style = th.Style;
            Width = th.Width;

            CellDisplayFormat = th.CellDisplayFormat;
            CellNullDisplayText = th.CellNullDisplayText;
            CellUihint = th.CellUihint;
{'fraction_non_alphanumeric': 0.08648025367541078, 'fraction_numerical': 0.0, 'mean_word_length': 1.9431721798134012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6956588', 'n_tokens_mistral': 915, 'n_tokens_neox': 916, 'n_words': 233}