Inheritance: System.EventArgs
Exemplo n.º 1
0
 private void myDetailTable_RowDeleted(object sender, System.Data.DataRowChangeEventArgs e)
 {
     if (myDetailTableChangedUpdate != null)
     {
         myDetailTableChangedUpdate();
     }
 }
Exemplo n.º 2
0
 void LibTable_RowChanged(object sender, DataRowChangeEventArgs e)
 {
     int SelectedIndex = dataLib.SelectedIndex;
     if (SelectedIndex == -1)
         return;
     LibTable.RowChanged -= LibTable_RowChanged;
     if (SelectedIndex > Lib.Count())
     {
         ArrayList a = new ArrayList(Lib);
         libraryies l = new libraryies();
         l.name = e.Row["name"].ToString();
         l.url = e.Row["url"].ToString();
         if (string.IsNullOrEmpty(l.url))
             l.url = null;
         a.Add(l);
         Lib = a.ToArray(typeof(libraryies)) as libraryies[];
         LibTable.RowChanged+=LibTable_RowChanged;
     }
     else
     {
         Lib[SelectedIndex].name = e.Row["name"].ToString();
         Lib[SelectedIndex].url = e.Row["url"].ToString();
         if (string.IsNullOrEmpty(Lib[SelectedIndex].url))
             Lib[SelectedIndex].url = null;
     }
     LibTable.RowChanged += LibTable_RowChanged;
     changed = true;
 }
Exemplo n.º 3
0
 void attributesTable_RowChanged(object sender, System.Data.DataRowChangeEventArgs e)
 {
     if (e.Action == DataRowAction.Add)
     {
         Geometries.Add(((FeatureDataRow)e.Row).Geometry);
     }
 }
Exemplo n.º 4
0
 void floor_item_map_RowChanged(object sender, System.Data.DataRowChangeEventArgs e)
 {
     if (e.Action == System.Data.DataRowAction.Change)
     {
         Refresh();
     }
 }
Exemplo n.º 5
0
		void Meta_RowChanged(object sender, DataRowChangeEventArgs e)
		{
			if (e.Action == DataRowAction.Change)
			{
				e.Row.AcceptChanges();
				Menu_SetCheckState();
			}
		}
Exemplo n.º 6
0
 private void Log_RowChanged(object sender, DataRowChangeEventArgs e)
 {
     if (e.Action == DataRowAction.Add)
     {
         var row = e.Row as LogDataSet.LogRow;
         AddRow(row);
     }
 }
Exemplo n.º 7
0
 protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e)
 {
     base.OnRowDeleted(e);
     if ((this.publishersRowDeleted != null))
     {
         this.publishersRowDeleted(this, new publishersRowChangeEvent(new publishersRow(e.Row), e.Action));
     }
 }
Exemplo n.º 8
0
 protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e)
 {
     base.OnRowDeleted(e);
     if ((this.MonkeyTableRowDeleted != null))
     {
         this.MonkeyTableRowDeleted(this, new MonkeyTableRowChangedEventArgs(((MonkeyTableRow)(e.Row)), e.Action));
     }
 }
Exemplo n.º 9
0
 protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e)
 {
     base.OnRowDeleting(e);
     if ((this.VoiceNoteRowDeleting != null))
     {
         this.VoiceNoteRowDeleting(this, new VoiceNoteRowChangeEvent(((VoiceNoteRow)(e.Row)), e.Action));
     }
 }
Exemplo n.º 10
0
 private static void Row_Deleting(object sender, DataRowChangeEventArgs e)
 {
     Console.WriteLine("Row_Deleting Event: name={0}; action={1}", e.Row[0], e.Action);
     foreach (DataRow dr in e.Row.GetChildRows("Detail_Master"))
     {
         dr.Delete();
     }
 }
Exemplo n.º 11
0
 protected override void OnRowChanging(System.Data.DataRowChangeEventArgs e)
 {
     base.OnRowChanging(e);
     if ((this.MyTableRowChanging != null))
     {
         this.MyTableRowChanging(this, new MyTableRowChangedEventArgs(((MyTableRow)(e.Row)), e.Action));
     }
 }
Exemplo n.º 12
0
 protected override void OnRowChanged(DataRowChangeEventArgs e)
 {
     if (mCanWrite && e.Action == DataRowAction.Add)
     {
         (e.Row as DataRowEx).OnAddRow();
     }
     base.OnRowChanged(e);
 }
Exemplo n.º 13
0
    private void Row_Changed(object sender,
                             System.Data.DataRowChangeEventArgs e)
    {
        DataTable table = (DataTable)sender;

        Console.WriteLine("RowChanged " + e.Action.ToString()
                          + "\table" + e.Row.ItemArray[0]);
    }
Exemplo n.º 14
0
 protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e)
 {
     base.OnRowDeleting(e);
     if ((this.titlesRowDeleting != null))
     {
         this.titlesRowDeleting(this, new titlesRowChangeEvent(new titlesRow(e.Row), e.Action));
     }
 }
Exemplo n.º 15
0
 private void Table_RowDeleted(object sender, System.Data.DataRowChangeEventArgs e)
 {
     System.Diagnostics.Debug.Assert((m_Node != null) && (m_Parent != null) && !m_disposed);
     if (e.Row != m_Parent)
     {
         return;
     }
     this.Dispose(true);
 }
Exemplo n.º 16
0
        private void ReceiptDetail_RowDeleted(object sender, DataRowChangeEventArgs e) 
        {
         //  if (e.Row.HasVersion(DataRowVersion.Original))
          // {

        //       MessageBox.Show((e.Row as RetailTrade.MDataSet.ReceiptDetailRow).ReceiptMasterRef.ToString());
                 //.ReceiptMasterRow.RecalcSum = true;
          // }
        }
 internal void DataChanged(DataRowChangeEventArgs args)
 {
     if (this.started && ((this.rowCounter != -1) || this.tableCleared))
     {
         DataRowAction action = args.Action;
         if (action <= DataRowAction.Rollback)
         {
             if ((action != DataRowAction.Delete) && (action != DataRowAction.Rollback))
             {
                 return;
             }
         }
         else if (action != DataRowAction.Commit)
         {
             if (action == DataRowAction.Add)
             {
                 this.ValidateRow(this.rowCounter + 1);
                 if (this.currentDataRow == this.currentDataTable.Rows[this.rowCounter + 1])
                 {
                     this.rowCounter++;
                     return;
                 }
             }
             return;
         }
         if (args.Row.RowState == DataRowState.Detached)
         {
             if (args.Row != this.currentDataRow)
             {
                 if (this.rowCounter != 0)
                 {
                     this.ValidateRow(this.rowCounter - 1);
                     if (this.currentDataRow == this.currentDataTable.Rows[this.rowCounter - 1])
                     {
                         this.rowCounter--;
                     }
                 }
             }
             else
             {
                 this.currentRowRemoved = true;
                 if (this.rowCounter > 0)
                 {
                     this.rowCounter--;
                     this.currentDataRow = this.currentDataTable.Rows[this.rowCounter];
                 }
                 else
                 {
                     this.rowCounter = -1;
                     this.currentDataRow = null;
                 }
             }
         }
     }
 }
Exemplo n.º 18
0
 void game_groups_RowChanged(object sender, System.Data.DataRowChangeEventArgs e)
 {
     if (e.Action == DataRowAction.Commit)
     {
         return;
     }
     if (!filling)
     {
         FillCurrent();
     }
 }
Exemplo n.º 19
0
 void session_game_groups_RowChanged(object sender, System.Data.DataRowChangeEventArgs e)
 {
     if (e.Action == DataRowAction.Commit)
     {
         return;
     }
     if (!filling)
     {
         FillCurrent();
     }
     //throw new NotImplementedException();
 }
Exemplo n.º 20
0
        void ObservableRowChanged(DataRowChangeEventArgs e)
        {
            if (e.Action != DataRowAction.Add && e.Action != DataRowAction.Delete && e.Action != DataRowAction.Change) 
                return;

            if (e.Action == DataRowAction.Add || e.Action == DataRowAction.Change)
            {
                SetRowIndexInCurrentAction(e);
            }

            EditableObject.EndEdit();
        }
Exemplo n.º 21
0
 private void CustomerAccounts_RowChanging(System.Object sender, System.Data.DataRowChangeEventArgs e)
 {
     // ----- The start date is required for active accounts.
     if (e.Row.HasVersion(DataRowVersion.Proposed) == true)
     {
         if (((bool)e.Row["Active", DataRowVersion.Proposed] == true) &&
             (DBNull.Value.Equals(e.Row["StartDate", DataRowVersion.Proposed]) == true))
         {
             e.Row.RowError = "Active accounts must have a valid start date.";
         }
     }
 }
 private void DataChanged(object sender, DataRowChangeEventArgs args)
 {
     DataTableReader target = (DataTableReader) this.readerWeak.Target;
     if (target != null)
     {
         target.DataChanged(args);
     }
     else
     {
         this.UnSubscribeEvents();
     }
 }
Exemplo n.º 23
0
        private void OnRowChanged(object sender, DataRowChangeEventArgs args)
        {
            int oldIndex, newIndex;

            oldIndex = newIndex = -1;
            oldIndex = IndexOf(args.Row);
            UpdateIndex(true);
            newIndex = IndexOf(args.Row);

            /* ItemAdded */
            if (args.Action == DataRowAction.Add && oldIndex != newIndex)
            {
                OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, newIndex, -1));
            }

            /* ItemChanged or ItemDeleted */
            if (args.Action == DataRowAction.Change)
            {
                if (oldIndex != -1 && oldIndex == newIndex)
                {
                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, newIndex, -1));
                }
                else if (oldIndex != newIndex)
                {
                    if (newIndex < 0)
                    {
                        OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, newIndex, oldIndex));
                    }
                    else
                    {
                        OnListChanged(new ListChangedEventArgs(ListChangedType.ItemMoved, newIndex, oldIndex));
                    }
                }
            }

            /* Rollback - ItemAdded or ItemDeleted */
            if (args.Action == DataRowAction.Rollback)
            {
                if (oldIndex < 0 && newIndex > -1)
                {
                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, newIndex, -1));
                }
                else if (oldIndex > -1 && newIndex < 0)
                {
                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, newIndex, oldIndex));
                }
                else if (oldIndex != -1 && oldIndex == newIndex)
                {
                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, newIndex, -1));
                }
            }
        }
Exemplo n.º 24
0
        private void DataChanged(object sender, DataRowChangeEventArgs args)
        {
            DataTableReader reader = (DataTableReader)_readerWeak.Target;

            if (reader != null)
            {
                reader.DataChanged(args);
            }
            else
            {
                UnSubscribeEvents();
            }
        }
Exemplo n.º 25
0
		private void custTable_RowChanging(object sender, DataRowChangeEventArgs e)
		{
			if (e.Action == System.Data.DataRowAction.Add || e.Action == System.Data.DataRowAction.Change)
			{
				if (e.Row["Min"] is System.DBNull || e.Row["Max"] is System.DBNull)
				{
				}
				else if ( (int)e.Row["Min"] > (int)e.Row["Max"])
				{
					throw new ApplicationException("Min must be <= Max");
				}
			}
		}
Exemplo n.º 26
0
        void Log_RowDeleted(object sender, DataRowChangeEventArgs e)
        {
            if (e.Action == DataRowAction.Delete)
            {
                var logId = (e.Row as LogDataSet.LogRow).LogId;
                LogListItem logListItem;

                if (logItemDictionary.TryGetValue(logId, out logListItem))
                {
                    logListView.Items.Remove(logListItem);
                    logItemDictionary.Remove(logId);
                }
            }
        }
Exemplo n.º 27
0
 //*/
 /* 수정 거부
 void tblPeople_ColumnChanging(object sender, DataColumnChangeEventArgs e)
 {
     if (e.Column.ColumnName == "Age")
     {
         if ((int)e.ProposedValue < 0 || (int)e.ProposedValue > 100)
         {
             MessageBox.Show("나이는 0 ~ 100 사이여야 합니다.");
             e.ProposedValue = e.Row["Age", DataRowVersion.Original];
         }
     }
 }
 //*/
 void tblPeople_RowChanging(object sender, DataRowChangeEventArgs e)
 {
     if ((bool)e.Row["Male"] == false)
     {
         if ((int)e.Row["Age"] > 40)
         {
             e.Row.SetColumnError("Age", "여성의 나이는 40세 이하여야 합니다.");
         }
         else
         {
             e.Row.SetColumnError("Age", "");
         }
     }
 }
Exemplo n.º 28
0
        private void OnRowDeleted(object sender, DataRowChangeEventArgs args)
        {
            /* ItemDeleted */
            int newIndex, oldCount;

            oldCount = Count;
            newIndex = IndexOf(args.Row);
            UpdateIndex(true);
            /* Fire ListChanged only when the RowFilter is affected */
            if (oldCount != Count)
            {
                OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, newIndex, -1));
            }
        }
 public void tblPeopleDataTable_RowChanging(object sender, DataRowChangeEventArgs e)
 {
     tblPeopleRow R = (tblPeopleRow)e.Row;
     if ((bool)R.Male == false)
     {
         if ((int)R.Age > 40)
         {
             e.Row.SetColumnError("Age", "여성의 나이는 40세 이하여야 합니다.");
         }
         else
         {
             e.Row.SetColumnError("Age", "");
         }
     }
 }
Exemplo n.º 30
0
 private void geotiff_RowDeleting(object sender, System.Data.DataRowChangeEventArgs e)
 {
     if (!rebuildingCustomMaps && !deletingCustomMaps)
     {
         try
         {
             int  column = 0;
             long cmId   = (long)((int)e.Row[column]);
             unlistCustomMap(cmId);
             CustomMapsCache.RemoveCustomMapById(cmId);
             PutOnMap();
         }
         catch {}
     }
 }
Exemplo n.º 31
0
        static void table_RowChanged(object sender, DataRowChangeEventArgs e)
        {            
            Trace.WriteLine(string.Format("DataTable_RowChanged(): Action {0}, RowState {1}", e.Action, e.Row.RowState));

            if (e.Action == DataRowAction.Add)
            {
                e.Row.AcceptChanges();
            }

            if (e.Action == DataRowAction.Change)
            {
                e.Row.AcceptChanges();

            }
        }
Exemplo n.º 32
0
        private void OnRowChanged(object src, DataRowChangeEventArgs args)
        {
            DataRowAction action = args.Action;
            DataRow       row    = args.Row;

            if (action == DataRowAction.Add)
            {
                if (_tableCleared && _current != -1)
                {
                    return;
                }

                if (_current == -1 || (_current >= 0 && row.RowID > CurrentRow.RowID))
                {
                    _tableCleared = false;
                    return;                     // no. movement required, if row added after current.
                }

                _current++;
                _rowRef = CurrentRow;
            }

            if (action == DataRowAction.Commit && row.RowState == DataRowState.Detached)
            {
                // if i am the row deleted, move one down
                if (_rowRef == row)
                {
                    _current--;
                    _rowRef = _current >= 0 ? CurrentRow : null;
                }

                // if the row deleted is the last row, move down
                if (_current >= CurrentTable.Rows.Count)
                {
                    _current--;
                    _rowRef = _current >= 0 ? CurrentRow : null;
                    return;
                }

                // deleting a row below _current moves the row one down
                if (_current > 0 && _rowRef == CurrentTable.Rows [_current - 1])
                {
                    _current--;
                    _rowRef = CurrentRow;
                    return;
                }
            }
        }
Exemplo n.º 33
0
        private static void OnRowChanged(object sender, DataRowChangeEventArgs args)
        {
            // A row has either been added or changed by the delta
            DataRow dataRow = args.Row;

            switch (args.Action)
            {
                case DataRowAction.Add:
                    Console.WriteLine("Row Added - Code: {0} 1 Dollar buys: {1:F6}.", dataRow["code"], dataRow["usdollar"]);
                    break;

                case DataRowAction.Change:
                    Console.WriteLine("Code: {0}, 1 US Dollar now buys: {1:F6}.", dataRow["code"], dataRow["usdollar"]);
                    break;
            }
        }
		private void Row_Changing( object sender, DataRowChangeEventArgs e )
		{
			// InRowChangingEventException - EndEdit
			try 
			{
				e.Row.EndEdit(); //can't invoke EndEdit while in ChangingEvent
				Assert.Fail("IRCEE2: Row.EndEdit failed to raise InRowChangingEventException.");
			}
			catch (InRowChangingEventException) {}
			catch (AssertionException) { throw; }
			catch (Exception exc)
			{
				Assert.Fail("IRCEE3: Columns.Add wrong exception type. Got: " + exc);
			}
			_EventTriggered = true;
		}
Exemplo n.º 35
0
 protected override void OnRowDeleting(DataRowChangeEventArgs e)
 {
     if (mCanWrite && e.Action == DataRowAction.Delete)
     {
         if (!(e.Row as DataRowEx).IsNewRow)
         {
             object[] keyValues = (e.Row as DataRowEx).KeyValues;
             if (keyValues == null)
             {
                 keyValues = (e.Row as DataRowEx).GetKeyValues();
                 (e.Row as DataRowEx).OnRowChanged();
             }
             mDeleteRowList.Add(keyValues);
         }
     }
     base.OnRowDeleting(e);
 }
Exemplo n.º 36
0
 void ObservableRowChanging(DataRowChangeEventArgs e)
 {
     if (e.Action == DataRowAction.Add)
     {
         EditableObject.BeginEdit(new RowAddEditAction(Observable));
     }
     else if (e.Action == DataRowAction.Delete)
     {
         EditableObject.BeginEdit(new RowDeleteEditAction(Observable, e.Row));
         SetRowIndexInCurrentAction(e);
     }
     else if (e.Action == DataRowAction.Change)
     {
         EditableObject.BeginEdit(new RowChangeEditAction(Observable, e.Row));
         SetRowIndexInCurrentAction(e);
     }
 }
Exemplo n.º 37
0
		protected override void OnRowDeleting(DataRowChangeEventArgs e)
			{
			base.OnRowDeleting(e);
			InformationAddOn rowToDelete = (InformationAddOn)e.Row;
			if ((rowToDelete.Tabelle == "Materialien")
				&& (rowToDelete.TabelleId != null)
				&& (rowToDelete.TabelleId != Guid.Empty))
				{
				Material material = DataContext.AltErlaaInfo.Materialien.Find(rowToDelete.TabelleId);
				if (material != null)
					{
					material.Delete();
					DataContext.AltErlaaInfo.Materialien.SaveChanges();
					DataContext.AltErlaaInfo.Materialien.AcceptChanges();
					}
				return;
				}
			if ((rowToDelete.Tabelle == "Timings")
				&& (rowToDelete.TabelleId != null)
				&& (rowToDelete.TabelleId != Guid.Empty))
				{
				Timing timing = DataContext.AltErlaaInfo.Timings.Find(rowToDelete.TabelleId);
				if (timing != null)
					{
					timing.Delete();
					DataContext.AltErlaaInfo.Timings.SaveChanges();
					DataContext.AltErlaaInfo.Timings.AcceptChanges();
					}
				return;
				}
			if ((rowToDelete.Tabelle == "ProcessConnector")
				&& (rowToDelete.TabelleId != null)
				&& (rowToDelete.TabelleId != Guid.Empty))
				{
				ProcessConnector processConnector = DataContext.AltErlaaInfo.ProcessConnectoren.Find(rowToDelete.TabelleId);
				if (processConnector != null)
					{
					processConnector.Delete();
					DataContext.AltErlaaInfo.ProcessConnectoren.SaveChanges();
					DataContext.AltErlaaInfo.ProcessConnectoren.AcceptChanges();
					}
				return;
				}
			}
Exemplo n.º 38
0
        static void table_RowChanging(object sender, DataRowChangeEventArgs e)
        {
            Loading load = new Loading();
            Trace.WriteLine(string.Format("DataTable_RowChanging(): Action {0}, RowState {1}", e.Action, e.Row.RowState));

            if (e.Action == DataRowAction.Add)
            {
                e.Row.ClearErrors();

                DataTable updateDataTable = load.RecalcData(sender as DataTable);
                
            }

            if (e.Action == DataRowAction.Change)
            {
                e.Row.ClearErrors();
                DataTable updateDataTable = load.RecalcData(sender as DataTable);
            }
        }
        void DataTableDifference_RowChanged(object sender, DataRowChangeEventArgs e)
        {
            DataRow row = e.Row;

            absRelUnlock(false);

            string temp = absDiffCalc(row).ToString();

            if (row["AbsDifference"].ToString() != temp)
            {
                row["AbsDifference"] = temp;
            }

            temp = relDiffCalc(row).ToString();

            if (row["RelDifference"].ToString() != temp)
            {
                row["RelDifference"] = temp;
            }

            absRelUnlock(true);
        }
Exemplo n.º 40
0
            void DevDataTable_RowChanged(object sender, System.Data.DataRowChangeEventArgs e)
            {
                switch (e.Action)
                {
                case System.Data.DataRowAction.Add:
                case System.Data.DataRowAction.Change:
                    devRow row = e.Row as devRow;
                    CheckType(row);
                    CheckAddress(row);
                    CheckIP(row);
                    CheckIPCamID(row);
                    CheckIPCamPassword(row);

                    if (!row.HasErrors)
                    {
                        lastInputIP         = row.ip;
                        lastInputSubnetMask = row.sm;
                        lastInputGateway    = row.gw;
                    }
                    break;
                }
            }
Exemplo n.º 41
0
        void Dictionary_RowChanged(object sender, DataRowChangeEventArgs e)
        {
            switch (e.Action)
            {
                case DataRowAction.Add:
                case DataRowAction.Change:
                    LanguageData dataLayer = new LanguageData();
                    dsLanguageData.DictionaryRow dict = toDictionaryRow((dsDictionary.DictionaryRow) e.Row);

                    if (isValidRow(dict))
                    {
                        int i = dataLayer.InsertOrUpdateDictionary(dict);
                        if (i > 0)
                        {
                            if (DataChanged != null)
                                DataChanged(this, new EventArgs());
                        }
                        dsDictionary.AcceptChanges();
                    }

                    break;
            }
        }
Exemplo n.º 42
0
        protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e)
        {
            object o = this.connection.ExecuteScalar("select count(*) from " + Names.schedule_prefix + "cardset_cards where cardset_id=" + e.Row["cardset_id"]);

            // no cardset_cards table?
            if (o == null)
            {
                return;
            }
            if (Convert.ToInt32(o) > 0)
            {
                if (MessageBox.Show("Are you sure you want to delete\n" + o + " rows from cardset data?"
                                    , "Confirm Data Deletion"
                                    , MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    this.connection.ExecuteNonQuery("delete from " + Names.schedule_prefix + "cardset_cards where cardset_id=" + e.Row["cardset_id"]);
                }
                else
                {
                    throw new Exception("Delete was aborted!?");
                }
            }
            base.OnRowDeleting(e);
        }
Exemplo n.º 43
0
        private DataRowChangeEventArgs RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction) {
            if (UpdatingCurrent(eRow, eAction) && (IsTypedDataTable || (null != onRowChangingDelegate))) {
                eRow.inChangingEvent = true;

                // don't catch
                try {
                    args = OnRowChanging(args, eRow, eAction);
                }
                finally {
                    eRow.inChangingEvent = false;
                }
            }
            // check if we deleting good row
            else if (DataRowAction.Delete == eAction && eRow.newRecord != -1 && (IsTypedDataTable || (null != onRowDeletingDelegate))) {
                eRow.inDeletingEvent = true;
                // don't catch
                try {
                    if (null == args) {
                        args = new DataRowChangeEventArgs(eRow, eAction);
                    }
                    OnRowDeleting(args);
                }
                finally {
                    eRow.inDeletingEvent = false;
                }
            }
            return args;
        }
Exemplo n.º 44
0
 private DataRowChangeEventArgs RaiseRowChanged(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction) {
     try {
         if (UpdatingCurrent(eRow, eAction) && (IsTypedDataTable || (null != onRowChangedDelegate))) {
             args = OnRowChanged(args, eRow, eAction);
         }
         // check if we deleting good row
         else if (DataRowAction.Delete == eAction && eRow.newRecord == -1 && (IsTypedDataTable || (null != onRowDeletedDelegate))) {
             if (null == args) {
                 args = new DataRowChangeEventArgs(eRow, eAction);
             }
             OnRowDeleted(args);
         }
     }
     catch (Exception f) {
        // 
        if (!Common.ADP.IsCatchableExceptionType(f)) {
          throw;
        }
        ExceptionBuilder.TraceExceptionWithoutRethrow(f);
        // ignore the exception
     }
     return args;
 }
Exemplo n.º 45
0
 /// <devdoc>
 ///    <para>
 ///       Raises the <see cref='System.Data.DataTable.OnRowDeleted'/> event.
 ///    </para>
 /// </devdoc>
 protected virtual void OnRowDeleted(DataRowChangeEventArgs e) {
     Debug.Assert((null != e) && ((null != onRowDeletedDelegate) || IsTypedDataTable), "OnRowDeleted arguments");
     if (onRowDeletedDelegate != null) {
         Bid.Trace("<ds.DataTable.OnRowDeleted|INFO> %d#\n", ObjectID);
         onRowDeletedDelegate(this, e);
     }
 }
Exemplo n.º 46
0
 private DataRowChangeEventArgs OnRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction) {
     if ((null != onRowChangingDelegate) || IsTypedDataTable) {
         if (null == args) {
             args = new DataRowChangeEventArgs(eRow, eAction);
         }
         OnRowChanging(args);
     }
     return args;
 }
Exemplo n.º 47
0
 private void CustomerAccounts_RowChanging(System.Object sender, System.Data.DataRowChangeEventArgs e)
 {
     // ----- The start date is required for active accounts.
 }
Exemplo n.º 48
0
 void attributesTable_RowDeleted(object sender, System.Data.DataRowChangeEventArgs e)
 {
     Geometries.Remove(((FeatureDataRow)e.Row).Geometry);
 }
Exemplo n.º 49
0
        protected void RowChangedEventHandler(object sender, System.Data.DataRowChangeEventArgs e)
        {
            if (myMngr.isMerging || isFilling || isInEvent)
            {
                return;
            }
            isInEvent = true;
            try
            {
                switch (e.Action)
                {
                case DataRowAction.Add:
                    if (e.Row.Table.Columns.Contains("entryDate"))
                    {
                        e.Row.BeginEdit();
                        e.Row["entryDate"] = DateTime.Now.ToUniversalTime();
                        if (myUser.Length > 20)
                        {
                            e.Row["entryUser"]  = myUser.Substring(myUser.Length - 20, 20);
                            e.Row["updateUser"] = myUser.Substring(myUser.Length - 20, 20);
                        }
                        else
                        {
                            e.Row["entryUser"]  = myUser;
                            e.Row["updateUser"] = myUser;
                        }
                        if (!myMngr.isMerging)
                        {
                            e.Row["updateDate"] = DateTime.Now.ToUniversalTime();
                        }
                        e.Row.EndEdit();
                    }
                    AfterAdd(e.Row);
                    if (myMngr.RuleHandler != null)
                    {
                        myMngr.RuleHandler.DynAfterAdd(myMngr, e.Row, myDefinition);
                    }
                    break;

                case DataRowAction.Delete:
                    AfterDelete(e.Row);
                    if (myMngr.RuleHandler != null)
                    {
                        myMngr.RuleHandler.DynAfterDelete(myMngr, e.Row, myDefinition);
                    }
                    break;

                case DataRowAction.Change:
                    if (!this.IsColumnChangeMode)
                    {
                        //						foreach(DataColumn dc in myDT.Columns)
                        //						{
                        //							if(e.Row.RowState==DataRowState.Added)
                        //							{
                        //								//this accounts for after change events that make calculations
                        //								//it does not catch things if the value is set to null
                        //								if(!e.Row.IsNull(dc))
                        //									AfterChange(dc,e.Row);
                        //							}
                        //							else
                        //							{
                        //
                        //								if(e.Row.HasVersion(DataRowVersion.Original))
                        //								{
                        //									if(!e.Row[dc,DataRowVersion.Current].Equals(e.Row[dc,DataRowVersion.Original]))
                        //									{
                        //										AfterChange(dc,e.Row);
                        //									}
                        //								}
                        //							}
                        //						}
                        //if(e.Row.Table.Columns.Contains("entryDate"))
                        //{
                        //    e.Row.BeginEdit();
                        //    e.Row["updateDate"]=DateTime.Now;
                        //    e.Row["updateUser"] = myUser;
                        //    e.Row.EndEdit();
                        //}
                    }

                    //						AfterUpdate(e.Row);
                    break;
                }
            }
            catch (Exception exc)
            {
                e.Row.RowError += exc.Message;
                System.Diagnostics.Debug.WriteLine(exc.Message);
            }
            finally
            {
                if (e.Row.HasErrors)
                {
                    foreach (DataColumn dc in e.Row.GetColumnsInError())
                    {
                        //e.Row[dc]=e.Row[dc,DataRowVersion.Original];
                    }
                }
                isInEvent = false;
            }
        }
Exemplo n.º 50
0
        private DataRowChangeEventArgs RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, bool fireEvent) {

            // check all constraints
            if (EnforceConstraints && !inLoad ) {
                int columnCount = columnCollection.Count;
                for(int i = 0; i < columnCount; ++i) {
                    DataColumn column = columnCollection[i];
                    if (!column.Computed || eAction != DataRowAction.Add) {
                        column.CheckColumnConstraint(eRow, eAction);
                    }
                }

                int constraintCount = constraintCollection.Count;
                for(int i = 0; i < constraintCount; ++i) {
                    constraintCollection[i].CheckConstraint(eRow, eAction);
                }
            }

            // $$anandra.  Check this event out. May be an issue.
            if (fireEvent) {
                args = RaiseRowChanging(args, eRow, eAction);
            }

            if (!inDataLoad) {
                // cascade things...
                if (!MergingData && eAction != DataRowAction.Nothing && eAction != DataRowAction.ChangeOriginal) {
                    CascadeAll(eRow, eAction);
                }
            }
            return args;
        }
Exemplo n.º 51
0
				protected override void OnRowChanged(DataRowChangeEventArgs e) 
				{
					base.OnRowChanged(e);
					if ((this.OrdersRowChanged != null)) 
					{
						this.OrdersRowChanged(this, new OrdersRowChangeEvent(((OrdersRow)(e.Row)), e.Action));
					}
				}
Exemplo n.º 52
0
 void Row_Changed(object sender, DataRowChangeEventArgs e)
 {
     switch ((string)e.Row[16]) {
         // Aktualisiert GUI-Felder für Werte die außerhalb der Tabelle angezeigt werden sollen
         case "00":
             FSR = Bank0[0x04];
             PCL = Bank0[0x02];
             PCLATH = Bank0[0x0a];
             Status = Bank0[0x03];
             // Status Flags
             IRP = Bank0[0x03] >> 7;
             RP1 = (Bank0[0x03] & 127) >> 6;
             RP0 = (Bank0[0x03] & 63) >> 5;
             T0 = (Bank0[0x03] & 31) >> 4;
             PD = (Bank0[0x03] & 15) >> 3;
             Z = (Bank0[0x03] & 7) >> 2;
             DC = (Bank0[0x03] & 3) >> 1;
             C = Bank0[0x03] & 1;
             RB = Bank0[0x06];
             RA = Bank0[0x05];
             RunTime = CycleCounter * 10;
             // Hervorhebung aktueller Zeile im Quelltext
             counter = (PCLATH << 8) | PCL;
             Parser.UpdateCurSourceLine(counter);
             break;
         default:
             break;
     }
 }
Exemplo n.º 53
0
        internal void DataChanged(DataRowChangeEventArgs args)
        {
            if ((!started) || (rowCounter == -1 && !tableCleared))
            {
                return;
            }

/*           if (rowCounter == -1 && tableCleared && args.Action == DataRowAction.Add) {
 *             tableCleared = false;
 *             return;
 *         }
 */
            switch (args.Action)
            {
            case DataRowAction.Add:
                ValidateRow(rowCounter + 1);

/*                   if (tableCleared) {
 *                     tableCleared = false;
 *                     rowCounter++;
 *                     currentDataRow = currentDataTable.Rows[rowCounter];
 *                     currentRowRemoved = false;
 *                 }
 *                 else
 */
                if (currentDataRow == currentDataTable.Rows[rowCounter + 1]) // check if we moved one position up
                {
                    rowCounter++;                                            // if so, refresh the datarow and fix the counter
                }
                break;

            case DataRowAction.Delete:    // delete
            case DataRowAction.Rollback:  // rejectchanges
            case DataRowAction.Commit:    // acceptchanges
                if (args.Row.RowState == DataRowState.Detached)
                {
                    if (args.Row != currentDataRow)
                    {
                        if (rowCounter == 0)    // if I am at first row and no previous row exist,NOOP
                        {
                            break;
                        }
                        ValidateRow(rowCounter - 1);
                        if (currentDataRow == currentDataTable.Rows[rowCounter - 1])      // one of previous rows is detached, collection size is changed!
                        {
                            rowCounter--;
                        }
                    }
                    else      // we are proccessing current datarow
                    {
                        currentRowRemoved = true;
                        if (rowCounter > 0)       // go back one row, no matter what the state is
                        {
                            rowCounter--;
                            currentDataRow = currentDataTable.Rows[rowCounter];
                        }
                        else       // we are on 0th row, so reset data to initial state!
                        {
                            rowCounter     = -1;
                            currentDataRow = null;
                        }
                    }
                }
                break;

            default:
                break;
            }
        }
Exemplo n.º 54
0
				protected override void OnRowDeleting(DataRowChangeEventArgs e) 
				{
					base.OnRowDeleting(e);
					if ((this.Order_DetailsRowDeleting != null)) 
					{
						this.Order_DetailsRowDeleting(this, new Order_DetailsRowChangeEvent(((Order_DetailsRow)(e.Row)), e.Action));
					}
				}
Exemplo n.º 55
0
 private void dataTable_Changed(object sender,
                                System.Data.DataRowChangeEventArgs e)
 {
     Console.WriteLine("Row Changed", e.Action,
                       e.Row[dataGrid1.CurrentCell.ColumnNumber]);
 }