Example #1
0
        /// <summary>コンストラクタ</summary>
        /// <param name="tblName">表名</param>
        public DTTable(string tblName)
        {
            // 表名の文字制限(正規表現チェックだが、
            // コンバートのことを考え棟梁部品は使用しない。)
            Regex rgx = new Regex("^[a-zA-Z0-9_-]+$");
            Match mch = rgx.Match(tblName);

            if (mch.Success)
            {
                // 表名が正しい

                // 表名を設定
                this._tblName = tblName;

                // 循環参照にならないように、表情報の共有オブジェクトを渡す。
                this._cols = new DTColumns(this._tblStat);
                this._rows = new DTRows(this._tblStat, this._cols);
            }
            else
            {
                // 表名が不正
                throw new Exception(
                          "A table name is inaccurate. "
                          + " Regular expression of the character which can be used:"
                          + " \"^[a-zA-Z0-9_-]+$\"");
            }
        }
Example #2
0
        /// <summary>
        /// コンストラクタでは列を必要とする。
        /// </summary>
        /// <param name="cols">列コレクション</param>
        /// <remarks>外部からは生成できないようにする</remarks>
        internal DTRow(DTColumns cols)
        {
            // 列コレクションを保持
            this._cols = cols;

            // 行データを生成する。
            foreach (DTColumn colInfo in this._cols.ColsInfo)
            {
                // 要素数分、初期値(null)
                this._row.Add(null);
            }

            // 行ステータスを初期化する
            this.RowState = DataRowState.Detached;
        }
Example #3
0
        /// <summary>
        /// コンストラクタでは列を必要とする。
        /// </summary>
        /// <param name="cols">列コレクション</param>
        /// <remarks>外部からは生成できないようにする</remarks>
        internal DTRow(DTColumns cols)
        {
            // 列コレクションを保持
            this._cols = cols;

            // 行データを生成する。
            foreach (DTColumn colInfo in this._cols.ColsInfo)
            {
                // 要素数分、初期値(null)
                this._row.Add(null);
            }

            // 行ステータスを初期化する
            this.RowState = DataRowState.Detached;
        }
Example #4
0
 /// <summary>コンストラクタ</summary>
 /// <param name="tblStat">表情報</param>
 /// <param name="cols">列コレクション</param>
 /// <remarks>外部からは生成できないようにする</remarks>
 internal DTRows(DTTableStatus tblStat, DTColumns cols)
 {
     this._tblStat = tblStat;
     this._cols    = cols;
 }
Example #5
0
 /// <summary>コンストラクタ</summary>
 /// <param name="tblStat">表情報</param>
 /// <param name="cols">列コレクション</param>
 /// <remarks>外部からは生成できないようにする</remarks>
 internal DTRows(DTTableStatus tblStat, DTColumns cols)
 {
     this._tblStat = tblStat;
     this._cols = cols;
 }
Example #6
0
        /// <summary>コンストラクタ</summary>
        /// <param name="tblName">表名</param>
        public DTTable(string tblName)
        {
            // 表名の文字制限(正規表現チェックだが、
            // コンバートのことを考え棟梁部品は使用しない。)
            Regex rgx = new Regex("^[a-zA-Z0-9_-]+$");
            Match mch = rgx.Match(tblName);
            
            if (mch.Success)
            {
                // 表名が正しい

                // 表名を設定
                this._tblName = tblName;

                // 循環参照にならないように、表情報の共有オブジェクトを渡す。
                this._cols = new DTColumns(this._tblStat);
                this._rows = new DTRows(this._tblStat, this._cols);
            }
            else
            {
                // 表名が不正
                throw new Exception(
                    "A table name is inaccurate. "
                    + " Regular expression of the character which can be used:"
                    + " \"^[a-zA-Z0-9_-]+$\"");
            }
        }