Пример #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
 public void RemoveTable(InternalDataTable dataTable)
 {
     this.ValidateRemoveTable(dataTable);
     this.Sign();
     foreach (var item in dataTable.ChildItems)
     {
         this.Tables.Remove(item);
     }
     this.Tables.Remove(dataTable);
 }
Пример #6
0
        internal CremaDataTable(InternalDataTable table)
        {
            this.table      = table;
            this.builder    = new CremaDataRowBuilder(this);
            this.columns    = new CremaDataColumnCollection(this.table);
            this.attributes = new CremaAttributeCollection(this.table);
            this.rows       = new CremaDataRowCollection(this.table);
            this.childs     = new CremaChildTableCollection(this.table);

            this.AttachEventHandlers();
        }
Пример #7
0
        public CremaDataTable(string name, string categoryPath)
        {
            this.builder    = new CremaDataRowBuilder(this);
            this.table      = new InternalDataTable(this, name, categoryPath);
            this.columns    = new CremaDataColumnCollection(this.table);
            this.attributes = new CremaAttributeCollection(this.table);
            this.rows       = new CremaDataRowCollection(this.table);
            this.childs     = new CremaChildTableCollection(this.table);

            this.AttachEventHandlers();
        }
Пример #8
0
 private void ValidateRemoveTable(InternalDataTable dataTable)
 {
     if (dataTable.DataSet != this)
     {
         throw new CremaDataException("DataSet에 속해 있지 않은 테이블은 제거할 수 없습니다.");
     }
     if (dataTable.Parent != null)
     {
         throw new CremaDataException(Resources.Exception_CannotRemoveChildTable);
     }
 }
Пример #9
0
 private void ValidateAddTable(InternalDataTable dataTable)
 {
     if (dataTable.DataSet != null)
     {
         throw new CremaDataException("이미 DataSet에 속해 있는 테이블은 추가할 수 없습니다.");
     }
     if (dataTable.Parent != null)
     {
         throw new CremaDataException(Resources.Exception_CannotAddChildTable);
     }
 }
Пример #10
0
 public bool CanRemoveTable(InternalDataTable dataTable)
 {
     if (dataTable == null)
     {
         return(false);
     }
     if (dataTable.DataSet != this)
     {
         return(false);
     }
     if (dataTable.Parent != null)
     {
         return(false);
     }
     return(this.Tables.CanRemove(dataTable));
 }
Пример #11
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);
        }
Пример #12
0
 internal CremaDataRowCollection(InternalDataTable table)
 {
     this.table    = table;
     this.rows     = table.Rows;
     this.itemList = table.RowList;
 }
Пример #13
0
 /// <summary>
 /// 4개 단위로 인자를 설정해야 함
 /// dataType, columnName, isKey, isUnique 순으로
 /// </summary>
 public static string GenerateHashValue(params object[] args)
 {
     return(InternalDataTable.GenerateHashValue(args));
 }
Пример #14
0
 public static string GenerateHashValue(params ColumnInfo[] columns)
 {
     return(InternalDataTable.GenerateHashValue(columns));
 }