/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Portions created by the Initial Developer are
 * Copyright (C) 2012 the Initial Developer.
 * All Rights Reserved.
 *
 * The Original Code is "http://semi-frame.googlecode.com/svn/trunk/".
 *
 * The Initial Developer of the Original Code is the author below.
 */

/**
 * @file Validater.cs
 * @brief auto generated.
 * @author mornongcloud
 * @date 2011/07/21
 */


using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
using System.Linq;

namespace masterframe.model.config
{
    /// <summary>
    /// Validater class
    /// </summary>
    public class Column
    {
        /// <summary>
        /// Validater setting
        /// </summary>
        public Dictionary<string, StColumn> config;

        /// <summary>
        /// setting structure  1:表示名 2:幅 3:フォーマット
        /// </summary>
        public struct StColumn
        {
            /// <summary>
            /// item name
            /// </summary>
            public string key;
            /// <summary>
            /// item name
            /// </summary>
            public string name;
            /// <summary>
            /// 
            /// </summary>
            public int width;
            /// <summary>
            /// 
            /// </summary>
            public string format;

            /// <summary>
            /// 
            /// </summary>
            /// <param name="nm"></param>
            /// <param name="ty"></param>
            /// <param name="mi"></param>
            /// <param name="ma"></param>
            public StColumn(string ky, string nm, int wd, string fm)
            {
                this.key = ky;
                this.name = nm;
                this.width = wd;
                this.format = fm;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Column()
        {
            //AVMCS_CORE.avm.util.ConfigUtil.GetSettingsList("VALIDATE");
            Dictionary<string, Object> dic = masterframe.util.ConfigUtil.GetSettings("COLUMN", new StColumn());
            config = dic.ToDictionary(o => o.Key, o => (StColumn)o.Value);
        }
    }
}
