internal CremaDataColumnCollection(InternalDataTable table)
 {
     this.table    = table;
     this.itemList = table.ColumnList;
     this.columns  = table.Columns;
     this.columns.CollectionChanged += Columns_CollectionChanged;
 }
Ejemplo n.º 2
0
 public void AddTable(InternalDataTable dataTable)
 {
     this.ValidateAddTable(dataTable);
     this.Tables.Add(dataTable);
     foreach (var item in dataTable.ChildItems)
     {
         this.Tables.Add(item);
     }
 }
        internal CremaChildTableCollection(InternalDataTable table)
        {
            this.table    = table;
            this.itemList = table.ChildItems;

            if (this.itemList is INotifyCollectionChanged childs)
            {
                childs.CollectionChanged += Childs_CollectionChanged;
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 4개 단위로 인자를 설정해야 함
 /// dataType, columnName, isKey, isUnique 순으로
 /// </summary>
 public static string GenerateHashValue(params object[] args)
 {
     return(InternalDataTable.GenerateHashValue(args));
 }
Ejemplo n.º 10
0
 public static string GenerateHashValue(params ColumnInfo[] columns)
 {
     return(InternalDataTable.GenerateHashValue(columns));
 }
Ejemplo n.º 11
0
 internal CremaDataRowCollection(InternalDataTable table)
 {
     this.table    = table;
     this.rows     = table.Rows;
     this.itemList = table.RowList;
 }