System.Data.DataTable.SetLocaleValue C# (CSharp) Method

SetLocaleValue() private method

private SetLocaleValue ( CultureInfo culture, bool userSet, bool resetIndexes ) : bool
culture CultureInfo
userSet bool
resetIndexes bool
return bool
        internal bool SetLocaleValue(CultureInfo culture, bool userSet, bool resetIndexes)
        {
            Debug.Assert(null != culture, "SetLocaleValue: no locale");
            if (userSet || resetIndexes || (!_cultureUserSet && !_culture.Equals(culture)))
            {
                _culture = culture;
                _compareInfo = null;
                _formatProvider = null;
                _hashCodeProvider = null;

                foreach (DataColumn column in Columns)
                {
                    column._hashCode = GetSpecialHashCode(column.ColumnName);
                }
                if (resetIndexes)
                {
                    ResetIndexes();
                    foreach (Constraint constraint in Constraints)
                    {
                        constraint.CheckConstraint();
                    }
                }
                return true;
            }
            return false;
        }

Usage Example

 public void Add(DataTable table)
 {
     IntPtr ptr;
     Bid.ScopeEnter(out ptr, "<ds.DataTableCollection.Add|API> %d#, table=%d\n", this.ObjectID, (table != null) ? table.ObjectID : 0);
     try
     {
         this.OnCollectionChanging(new CollectionChangeEventArgs(CollectionChangeAction.Add, table));
         this.BaseAdd(table);
         this.ArrayAdd(table);
         if (table.SetLocaleValue(this.dataSet.Locale, false, false) || table.SetCaseSensitiveValue(this.dataSet.CaseSensitive, false, false))
         {
             table.ResetIndexes();
         }
         this.OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Add, table));
     }
     finally
     {
         Bid.ScopeLeave(ref ptr);
     }
 }
All Usage Examples Of System.Data.DataTable::SetLocaleValue
DataTable