private void DataTableCleared(object sender, DataTableClearEventArgs e) {
     DataTableReader reader = (DataTableReader) readerWeak.Target;
     if (reader != null) {
         reader.DataTableCleared();
     }
     else {
         UnSubscribeEvents();
     }
      
 }
 private void DataTableCleared(object sender, DataTableClearEventArgs e)
 {
     DataTableReader target = (DataTableReader) this.readerWeak.Target;
     if (target != null)
     {
         target.DataTableCleared();
     }
     else
     {
         this.UnSubscribeEvents();
     }
 }
Ejemplo n.º 3
0
        private void DataTableCleared(object sender, DataTableClearEventArgs e)
        {
            DataTableReader target = (DataTableReader)this.readerWeak.Target;

            if (target != null)
            {
                target.DataTableCleared();
            }
            else
            {
                this.UnSubscribeEvents();
            }
        }
Ejemplo n.º 4
0
        private void DataTableCleared(object sender, DataTableClearEventArgs e)
        {
            DataTableReader reader = (DataTableReader)_readerWeak.Target;

            if (reader != null)
            {
                reader.DataTableCleared();
            }
            else
            {
                UnSubscribeEvents();
            }
        }
 internal void Clear(bool clearAll)
 {
     IntPtr ptr;
     Bid.ScopeEnter(out ptr, "<ds.DataTable.Clear|INFO> %d#, clearAll=%d{bool}\n", this.ObjectID, clearAll);
     try
     {
         this.rowDiffId = null;
         if (this.dataSet != null)
         {
             this.dataSet.OnClearFunctionCalled(this);
         }
         bool flag = this.Rows.Count != 0;
         DataTableClearEventArgs e = null;
         if (flag)
         {
             e = new DataTableClearEventArgs(this);
             this.OnTableClearing(e);
         }
         if ((this.dataSet != null) && this.dataSet.EnforceConstraints)
         {
             ParentForeignKeyConstraintEnumerator enumerator3 = new ParentForeignKeyConstraintEnumerator(this.dataSet, this);
             while (enumerator3.GetNext())
             {
                 enumerator3.GetForeignKeyConstraint().CheckCanClearParentTable(this);
             }
         }
         this.recordManager.Clear(clearAll);
         foreach (DataRow row in this.Rows)
         {
             row.oldRecord = -1;
             row.newRecord = -1;
             row.tempRecord = -1;
             row.rowID = -1L;
             row.RBTreeNodeId = 0;
         }
         this.Rows.ArrayClear();
         this.ResetIndexes();
         if (flag)
         {
             this.OnTableCleared(e);
         }
         foreach (DataColumn column in this.Columns)
         {
             this.EvaluateDependentExpressions(column);
         }
     }
     finally
     {
         Bid.ScopeLeave(ref ptr);
     }
 }
Ejemplo n.º 6
0
 private void DataTable_TableCleared(object sender, DataTableClearEventArgs e)
 {
     RefreshDataTable();
 }
Ejemplo n.º 7
0
 private void HandleFeaturesCleared(object sender, DataTableClearEventArgs e)
 {
     //maybe clear extents
     //ok, maybe not
 }
Ejemplo n.º 8
0
 void dtDataSourceTemp_TableCleared(object sender, DataTableClearEventArgs e)
 {
     InitSelectedColumnData(false);
 }
Ejemplo n.º 9
0
 private void OnTableCleared(object src, DataTableClearEventArgs args)
 {
     _tableCleared = true;
 }
Ejemplo n.º 10
0
 void itemTable_TableCleared(object sender, DataTableClearEventArgs e)
 {
     listViewItem.Items.Clear();
 }
Ejemplo n.º 11
0
        internal void Clear(bool clearAll) {
            IntPtr hscp;
            Bid.ScopeEnter(out hscp, "<ds.DataTable.Clear|INFO> %d#, clearAll=%d{bool}\n", ObjectID, clearAll);

            try {
                Debug.Assert(null == rowDiffId, "wasn't previously cleared");
                rowDiffId = null;

                if (dataSet != null)
                    dataSet.OnClearFunctionCalled(this);
                bool shouldFireClearEvents = (this.Rows.Count != 0); // if Rows is already empty, this is noop

                DataTableClearEventArgs e = null;
                if (shouldFireClearEvents) {
                    e = new DataTableClearEventArgs (this);
                    OnTableClearing(e);
                }

                if (dataSet != null && dataSet.EnforceConstraints) {

                    for (ParentForeignKeyConstraintEnumerator constraints = new ParentForeignKeyConstraintEnumerator(dataSet, this); constraints.GetNext();) {
                        ForeignKeyConstraint constraint = constraints.GetForeignKeyConstraint();
                        constraint.CheckCanClearParentTable(this);
                    }
                }

                recordManager.Clear(clearAll);

                // SQLBU 415729: Serious performance issue when calling Clear()
                // this improves performance by iterating over rows instead of computing by index
                foreach(DataRow row in Rows) {
                    row.oldRecord = -1;
                    row.newRecord = -1;
                    row.tempRecord = -1;
                    row.rowID = -1;
                    row.RBTreeNodeId = 0;
                }
                Rows.ArrayClear();

                ResetIndexes();

                if (shouldFireClearEvents) {
                    OnTableCleared(e);
                }

                // SQLBU 501916 - DataTable internal index is corrupted:'5'
                foreach(DataColumn column in Columns) {
                    EvaluateDependentExpressions(column);
                }
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }
 protected virtual void OnTableCleared(DataTableClearEventArgs e)
 {
     if (this.onTableClearedDelegate != null)
     {
         Bid.Trace("<ds.DataTable.OnTableCleared|INFO> %d#\n", this.ObjectID);
         this.onTableClearedDelegate(this, e);
     }
 }
Ejemplo n.º 13
0
		private void OnTableClearing (object src, DataTableClearEventArgs args)
		{
			_tableClearingEventFired = true;
		}
Ejemplo n.º 14
0
 void AreaTable_TableClearing(object sender, DataTableClearEventArgs e)
 {
     foreach (GeometryObj obj in GetObjects())
     {
         DXControl.GeoObjects.Remove(obj);
     }
     ClearObjectRowMapping();
 }
Ejemplo n.º 15
0
 protected virtual void OnTableClearing(DataTableClearEventArgs e)
 {
     if (_onTableClearingDelegate != null)
     {
         DataCommonEventSource.Log.Trace("<ds.DataTable.OnTableClearing|INFO> {0}", ObjectID);
         _onTableClearingDelegate(this, e);
     }
 }
Ejemplo n.º 16
0
        internal void Clear(bool clearAll)
        {
            long logScopeId = DataCommonEventSource.Log.EnterScope("<ds.DataTable.Clear|INFO> {0}, clearAll={1}", ObjectID, clearAll);
            try
            {
                Debug.Assert(null == _rowDiffId, "wasn't previously cleared");
                _rowDiffId = null;

                if (_dataSet != null)
                    _dataSet.OnClearFunctionCalled(this);
                bool shouldFireClearEvents = (Rows.Count != 0); // if Rows is already empty, this is noop

                DataTableClearEventArgs e = null;
                if (shouldFireClearEvents)
                {
                    e = new DataTableClearEventArgs(this);
                    OnTableClearing(e);
                }

                if (_dataSet != null && _dataSet.EnforceConstraints)
                {
                    for (ParentForeignKeyConstraintEnumerator constraints = new ParentForeignKeyConstraintEnumerator(_dataSet, this); constraints.GetNext();)
                    {
                        ForeignKeyConstraint constraint = constraints.GetForeignKeyConstraint();
                        constraint.CheckCanClearParentTable(this);
                    }
                }

                _recordManager.Clear(clearAll);

                // this improves performance by iterating over rows instead of computing by index
                foreach (DataRow row in Rows)
                {
                    row._oldRecord = -1;
                    row._newRecord = -1;
                    row._tempRecord = -1;
                    row.rowID = -1;
                    row.RBTreeNodeId = 0;
                }
                Rows.ArrayClear();

                ResetIndexes();

                if (shouldFireClearEvents)
                {
                    OnTableCleared(e);
                }

                foreach (DataColumn column in Columns)
                {
                    EvaluateDependentExpressions(column);
                }
            }
            finally
            {
                DataCommonEventSource.Log.ExitScope(logScopeId);
            }
        }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// datatablecleareventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this DataTableClearEventHandler datatablecleareventhandler, Object sender, DataTableClearEventArgs e, AsyncCallback callback)
        {
            if(datatablecleareventhandler == null) throw new ArgumentNullException("datatablecleareventhandler");

            return datatablecleareventhandler.BeginInvoke(sender, e, callback, null);
        }
 void Anaylzed_TableCleared(object sender, DataTableClearEventArgs e)
 {
     DotRowList.Clear();
 }
Ejemplo n.º 19
0
 void npcTable_TableCleared(object sender, DataTableClearEventArgs e)
 {
     listViewNPC.Items.Clear();
 }
Ejemplo n.º 20
0
 protected virtual void OnTableClearing(DataTableClearEventArgs e) {
     if (onTableClearingDelegate != null) {
         Bid.Trace("<ds.DataTable.OnTableClearing|INFO> %d#\n", ObjectID);
         onTableClearingDelegate(this, e);
     }
 }
Ejemplo n.º 21
0
                /// <summary>
		/// Raises TableCleared Event and delegates to subscribers
		/// </summary>
		protected virtual void OnTableCleared (DataTableClearEventArgs e) {
			if (TableCleared != null)
				TableCleared (this, e);
		}