private void InitDelegateFields() { columnChanged = new DataColumnChangeEventHandler(OnDataTableColumnChanged); rowDeleted = new DataRowChangeEventHandler(OnDataTableRowDeleted); rowChanged = new DataRowChangeEventHandler(OnDataTableRowChanged); tablesChanged = new CollectionChangeEventHandler(OnDataTableChanged); }
public SessionGameGroupGameOrder(DsnConnection odbc, DataSet dataset) : base(odbc, dataset , dataset.Tables[SessionTable.TableName] as XDataTable , new MySQLRelationMap(new object[] { dataset.Tables[SessionTable.TableName] as XDataTable , MySQLRelationMap.MapOp.SaveRelationPoint , MySQLRelationMap.MapOp.FollowTo , PackGroupTable.TableName , MySQLRelationMap.MapOp.InvokNameChangeEvent , MySQLRelationMap.MapOp.FollowTo , GameTable.TableName , MySQLRelationMap.MapOp.InvokNameChangeEvent }).ToString() //, ".session_has_game_group.\\game_group_in_session$/game_group_has_game.\\game_in_game_group$" , false , false , new DataColumn[] { new DataColumn("game_number", typeof(int)) , new DataColumn("ball_timer", typeof(int)) , new DataColumn("overlap_prior", typeof(bool)) , new DataColumn("progressive", typeof(bool)) , new DataColumn("bonanza", typeof(bool)) , new DataColumn("wild", typeof(bool)) , new DataColumn("double_wild", typeof(bool)) , new DataColumn("blind", typeof(bool)) , new DataColumn("single_hotball", typeof(bool)) , new DataColumn(ColorInfoTable.PrimaryKey, XDataTable.DefaultAutoKeyType) } ) { foreach (string name in DataColumns) { this.Columns[name].AllowDBNull = false; this.Columns[name].DefaultValue = 0; } if (dataset != null) { DataTable child; dataset.Relations.Add(SessionGameGroupGameOrder.color_name = MySQLDataTable.StripPlural(MySQLDataTable.StripInfo(SessionGameGroupGameOrder.TableName)) + "_is_" + MySQLDataTable.StripPlural(MySQLDataTable.StripInfo(ColorInfoTable.TableName)) , dataset.Tables[ColorInfoTable.TableName].Columns[ColorInfoTable.PrimaryKey] , (child = dataset.Tables[SessionGameGroupGameOrder.TableName]).Columns[ColorInfoTable.PrimaryKey] ); ForeignKeyConstraint fkc = child.Constraints[color_name] as ForeignKeyConstraint; if (fkc != null) { fkc.DeleteRule = Rule.SetNull; } } number_column = NumberColumn; AddingRow += new OnNewRow(initrow); FixupRow += new OnFixupRow(SessionGameGroupGameOrder_FixupRow); //Create(); //base.Fill(null, NumberColumn+",overlap_prior"); ColumnChanged += new DataColumnChangeEventHandler(SessionGameGroupGameOrder_ColumnChanged); }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// datacolumnchangeeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this DataColumnChangeEventHandler datacolumnchangeeventhandler, Object sender, DataColumnChangeEventArgs e, AsyncCallback callback) { if (datacolumnchangeeventhandler == null) { throw new ArgumentNullException("datacolumnchangeeventhandler"); } return(datacolumnchangeeventhandler.BeginInvoke(sender, e, callback, null)); }
List <int> m_columnToSeries; // index to series from each column in table /// <summary> /// Creates a DataTable composed from multiple time series /// </summary> public SeriesListDataTable(SeriesList list, TimeInterval interval) : base(interval.ToString()) { m_seriesList = list.FilteredList(interval); m_columnToSeries = new List <int>(); CreateMultiColumnSchema(); AddData(); AcceptChanges(); ColumnChanged += new DataColumnChangeEventHandler(m_table_ColumnChanged); SetupPrimaryKey(); }
/// <summary> /// Creates a DataTable composed from multiple time series /// </summary> /// <param name="ds">The TimeSeriesDataset passed to the constructor /// should contain time series data.</param> /// <param name="interval">one of : hour,day,year,wy </param> public MultipleSeriesDataTable(GraphData ds, string interval) : base(interval) { this.ds = ds; s_instanceCounter++; Logger.WriteLine("MultipleSeriesDataTable(" + interval + ") + instanceCounter= " + s_instanceCounter); m_instanceNumber = s_instanceCounter; m_tblList = new List <DataTable>(); m_Series = new List <TimeSeriesDataSet.SeriesRow>(); m_seriesIndexList = new List <int>(); m_columnTitle = new List <string>(); for (int i = 0; i < ds.SeriesRows.Count(); i++) { TimeSeriesDataSet.SeriesRow s = ds.SeriesRows.Skip(i).First(); DataTable tbl = ds.Tables[s.TableName]; if (String.Compare(s.Interval, interval, true) == 0) { m_tblList.Add(tbl); // set the sort order so we can do fast lookups in // The TimeSeriesDataSet code : DefaultView.Find(t) tbl.DefaultView.Sort = tbl.Columns[0].ColumnName; tbl.DefaultView.ApplyDefaultSort = true; m_Series.Add(s); string title = s.SiteName + " " + s.ParameterType; title += " " + s.Units; if (s.hdb_r_table == "r_base") {// this is needed because r_base could be any interval. // we need to identify it as different title += " - base"; } m_columnTitle.Add(title); m_seriesIndexList.Add(i); } } CreateMultiColumnTable(); AcceptChanges(); ColumnChanged += new DataColumnChangeEventHandler(m_table_ColumnChanged); SetupPrimaryKey(); SetupReadOnly(); }
public void BindDocumentData(lmDatasets.docDB.DocumentDataTable a, bool DocSearchResults, atriumBE.DocManager dm) { myDM = dm; //ucDocPreview1.Init(dm); ucDocView1.Init(dm); //if(!FM.IsVirtualFM) // dm.GetRecipient().LoadByFileId(FM.CurrentFile.FileId); ucRecordList1.Init(myDM); DataView dv = new DataView(a, "", "", DataViewRowState.ModifiedCurrent | DataViewRowState.Unchanged); this.documentBindingSource.DataSource = dv; this.documentBindingSource.DataMember = ""; if (firstTime) { dcceh = new DataColumnChangeEventHandler(a_ColumnChanged); a.ColumnChanged += dcceh; dm.DB.DocContent.ColumnChanged += dcceh; dm.DB.Recipient.ColumnChanged += dcceh; ueh = new atLogic.UpdateEventHandler(ucRecords_OnUpdate); dm.GetDocument().OnUpdate += ueh; dm.GetDocContent().OnUpdate += ueh; dm.GetRecipient().OnUpdate += ueh; } firstTime = false; if (DocSearchResults) { pnlGrid.CaptionVisible = Janus.Windows.UI.InheritableBoolean.False; } ucRecordList1.SearchResult(DocSearchResults); if (documentBindingSource.Current != null) { ApplySecurity(CurrentRow()); } NoData(documentBindingSource.Count == 0); if (documentBindingSource.Count > 0) { timer1.Start(); } }
public static void CheckRowColumn(DataRowChangeEventArgs e, DataColumnChangeEventHandler columnChecker) { if (e.Action == System.Data.DataRowAction.Add || e.Action == System.Data.DataRowAction.Change) { if (e.Row.RowState != System.Data.DataRowState.Deleted) { DataColumn currentcol = null; DataColumnChangeEventArgs args = null; foreach (System.Data.DataColumn col in e.Row.Table.Columns) { currentcol = col; args = new System.Data.DataColumnChangeEventArgs(e.Row, currentcol, e.Row[currentcol]); columnChecker(null, args); } } } }
public SessionGame(DataSet dataset) : base(dataset) { DataColumn dc; Columns.Add(new DataColumn(NameColumn, typeof(String))); Columns.Add(dc = new DataColumn("game_part_number", typeof(String))); dc.MaxLength = 8; Columns.Add(new DataColumn("ball_timer", typeof(int))); Columns.Add(new DataColumn("progressive", typeof(bool))); Columns.Add(new DataColumn("bonanza", typeof(bool))); Columns.Add(new DataColumn("wild", typeof(bool))); Columns.Add(new DataColumn("double_wild", typeof(bool))); Columns.Add(new DataColumn("blind", typeof(bool))); Columns.Add(new DataColumn("poker", typeof(bool))); Columns.Add(new DataColumn("special", typeof(bool))); Columns.Add(new DataColumn("single_hotball", typeof(bool))); Columns.Add(new DataColumn("callers_choice", typeof(bool))); Columns.Add(new DataColumn(ColorInfoTable.PrimaryKey, XDataTable.DefaultAutoKeyType)); if (dataset != null) { DataTable child; dataset.Relations.Add(SessionGame.color_name = MySQLDataTable.StripPlural(MySQLDataTable.StripInfo(SessionGame.TableName)) + "_is_" + MySQLDataTable.StripPlural(MySQLDataTable.StripInfo(ColorInfoTable.TableName)) , dataset.Tables[ColorInfoTable.TableName].Columns[ColorInfoTable.PrimaryKey] , (child = dataset.Tables[SessionGame.TableName]).Columns[ColorInfoTable.PrimaryKey] ); ForeignKeyConstraint fkc = child.Constraints[color_name] as ForeignKeyConstraint; if (fkc != null) { fkc.DeleteRule = Rule.SetNull; } } number_column = NumberColumn; // these are event catches to make sure numbers track correctly. CloneRow += new MySQLRelationTable.OnCloneRow(SessionGame_CloneRow); AddingRow += new MySQLRelationTable.OnNewRow(initrow); ColumnChanged += new DataColumnChangeEventHandler(SessionGame_ColumnChanged); }
/// <summary> /// Forces the check-up of a Data Row according to the DataColumnChangeEventHandler given /// </summary> /// <typeparam name="T">DatTable, DataRow[] or DataRow</typeparam> /// <param name="table2"> object to check</param> /// <param name="columnChecker">DataColumnChangeEventHandler to use for checking</param> public static void CheckRows <T>(T table2, DataColumnChangeEventHandler columnChecker) { Type tipo = typeof(T); if (tipo.Equals(typeof(DataTable))) { DataTable dt = table2 as DataTable; DataRow[] rows = dt.Rows.OfType <DataRow>().ToArray(); CheckRows(rows, columnChecker); } else if (tipo.Equals(typeof(DataRow[]))) { IEnumerable <DataRow> rows = table2 as IEnumerable <DataRow>; foreach (DataRow r in rows) { CheckRows(r, columnChecker); } } else if (tipo.Equals(typeof(DataRow))) { DataRow r = table2 as DataRow; DataRow currentRow = null; currentRow = r; DataRowChangeEventArgs args = new DataRowChangeEventArgs(currentRow, DataRowAction.Change); if (currentRow.RowState == DataRowState.Unchanged) { currentRow.SetModified(); } EC.CheckRowColumn(args, columnChecker); currentRow.AcceptChanges(); } else { NotImplemented(); } }
public SessionGameOrder(DsnConnection odbc, DataSet dataset) : base(odbc, dataset , new DataColumn[] { new DataColumn("ball_timer", typeof(int)) , new DataColumn("overlap_prior", typeof(bool)) , new DataColumn("progressive", typeof(bool)) , new DataColumn("bonanza", typeof(bool)) , new DataColumn("wild", typeof(bool)) , new DataColumn("double_wild", typeof(bool)) , new DataColumn("blind", typeof(bool)) , new DataColumn("single_hotball", typeof(bool)) , new DataColumn(ColorInfoTable.PrimaryKey, XDataTable.DefaultAutoKeyType) } ) { if (dataset != null) { DataTable child; /* * dataset.Relations.Add( SessionGameGroupGameOrder.color_name = MySQLDataTable.StripPlural( MySQLDataTable.StripInfo( SessionGameGroupGameOrder.TableName ) ) + "_is_" + MySQLDataTable.StripPlural( MySQLDataTable.StripInfo( ColorInfoTable.TableName ) ) + , dataset.Tables[ColorInfoTable.TableName].Columns[ColorInfoTable.PrimaryKey] + , ( child = dataset.Tables[SessionGameGroupGameOrder.TableName] ).Columns[ColorInfoTable.PrimaryKey] + ); + ForeignKeyConstraint fkc = child.Constraints[color_name] as ForeignKeyConstraint; + if( fkc != null ) + fkc.DeleteRule = Rule.SetNull; */ } //number_column = NumberColumn; AddingRow += new OnNewRow(initrow); FixupRow += new OnFixupRow(SessionGameGroupGameOrder_FixupRow); //Create(); //base.Fill(null, NumberColumn+",overlap_prior"); ColumnChanged += new DataColumnChangeEventHandler(SessionGameGroupGameOrder_ColumnChanged); }
private void InitDelegateFields () { columnChanged = new DataColumnChangeEventHandler (OnDataTableColumnChanged); rowDeleted = new DataRowChangeEventHandler (OnDataTableRowDeleted); rowChanged = new DataRowChangeEventHandler (OnDataTableRowChanged); tablesChanged = new CollectionChangeEventHandler (OnDataTableChanged); }