コード例 #1
0
 internal CremaDataColumnCollection(InternalDataTable table)
 {
     this.table    = table;
     this.itemList = table.ColumnList;
     this.columns  = table.Columns;
     this.columns.CollectionChanged += Columns_CollectionChanged;
 }
コード例 #2
0
 public void AddTable(InternalDataTable dataTable)
 {
     this.ValidateAddTable(dataTable);
     this.Tables.Add(dataTable);
     foreach (var item in dataTable.ChildItems)
     {
         this.Tables.Add(item);
     }
 }
コード例 #3
0
        internal CremaChildTableCollection(InternalDataTable table)
        {
            this.table    = table;
            this.itemList = table.ChildItems;

            if (this.itemList is INotifyCollectionChanged childs)
            {
                childs.CollectionChanged += Childs_CollectionChanged;
            }
        }
コード例 #4
0
        public InternalDataTable AddTable(string name, string categoryPath)
        {
            var dataTable     = new InternalDataTable(name, categoryPath);
            var signatureDate = this.Sign();

            this.Tables.Add(dataTable);
            dataTable.InternalCreationInfo     = signatureDate;
            dataTable.InternalModificationInfo = signatureDate;
            return(dataTable);
        }
コード例 #5
0
        internal CremaDataTable(InternalDataTable table)
        {
            this.InternalObject = table;
            this.builder        = new CremaDataRowBuilder(this);
            this.Columns        = new CremaDataColumnCollection(this.InternalObject);
            this.Attributes     = new CremaAttributeCollection(this.InternalObject);
            this.Rows           = new CremaDataRowCollection(this.InternalObject);
            this.Childs         = new CremaChildTableCollection(this.InternalObject);

            this.AttachEventHandlers();
        }
コード例 #6
0
 public bool CanRemoveTable(InternalDataTable dataTable)
 {
     if (dataTable == null)
     {
         return(false);
     }
     if (dataTable.DataSet != this)
     {
         return(false);
     }
     if (dataTable.ParentName != string.Empty && dataTable.TemplatedParentName != string.Empty)
     {
         return(false);
     }
     return(true);
 }
コード例 #7
0
        public void RemoveTable(InternalDataTable dataTable)
        {
            this.ValidateRemoveTable(dataTable);
            this.Sign();

            if (dataTable.ParentName != string.Empty)
            {
                var derivedItems = dataTable.DerivedItems.ToArray();
                foreach (var item in derivedItems)
                {
                    this.Tables.Remove(item);
                }
            }

            foreach (var item in dataTable.ChildItems)
            {
                this.Tables.Remove(item);
            }
            this.Tables.Remove(dataTable);
        }
コード例 #8
0
        public InternalDataTable AddTable(TableInfo tableInfo)
        {
            this.ValidateAddTable(tableInfo);
            var dataTable = new InternalDataTable(tableInfo.TableName, tableInfo.CategoryPath)
            {
                InternalTableID = tableInfo.ID,
                InternalTags    = tableInfo.Tags,
                InternalComment = tableInfo.Comment
            };

            this.Tables.Add(dataTable);

            for (var i = 0; i < tableInfo.Columns.Length; i++)
            {
                dataTable.AddColumn(tableInfo.Columns[i]);
            }

            dataTable.InternalCreationInfo     = tableInfo.CreationInfo;
            dataTable.InternalModificationInfo = tableInfo.ModificationInfo;
            dataTable.InternalContentsInfo     = tableInfo.ContentsInfo;
            dataTable.AcceptChanges();
            return(dataTable);
        }
コード例 #9
0
 /// <summary>
 /// 4개 단위로 인자를 설정해야 함
 /// dataType, columnName, isKey, isUnique 순으로
 /// </summary>
 public static string GenerateHashValue(params object[] args)
 {
     return(InternalDataTable.GenerateHashValue(args));
 }
コード例 #10
0
 public static string GenerateHashValue(params ColumnInfo[] columns)
 {
     return(InternalDataTable.GenerateHashValue(columns));
 }
コード例 #11
0
 internal CremaDataRowCollection(InternalDataTable table)
 {
     this.table    = table;
     this.rows     = table.Rows;
     this.itemList = table.RowList;
 }