DekGenius.com
[ Team LiB ] Previous Section Next Section

CurrencyManager

System.Windows.Forms (system.windows.forms.dll)class

This class represents a bag of Binding objects for a list-like data source. List-like objects (such as arrays, collections, and System.Data.DataTable objects) implement IList, System.ComponentModel.IListSource, or System.ComponentModel.IBindingList. Compare this with PropertyManager that deals with simple properties.

It maintains the concept of the Current item in the list. When the current item is changed (by setting the Position property, or because the System.ComponentModel.IBindingList.ListChanged event was raised), all the objects bound to the data source through the Binding objects are updated with the new value. (See Binding for details on how this update can be controlled through the Parse and Format events).

Note that the standard controls such as ListBox and DataGrid will update the Position automatically as the UI selection changes.

See Binding for more information on the data-binding hierarchy.

public class CurrencyManager : BindingManagerBase {
// Protected Instance Fields
   protected Type finalType;
   protected int listposition;
// Public Instance Properties
   public override int Count{get; } // overrides BindingManagerBase
   public override object Current{get; } // overrides BindingManagerBase
   public IList List{get; }
   public override int Position{set; get; } // overrides BindingManagerBase
// Public Instance Methods
   public override void AddNew();  // overrides BindingManagerBase
   public override void CancelCurrentEdit();  // overrides BindingManagerBase
   public override void EndCurrentEdit();  // overrides BindingManagerBase
   public override PropertyDescriptorCollection GetItemProperties();  // overrides BindingManagerBase
   public void Refresh();
   public override void RemoveAt(int index);  // overrides BindingManagerBase
   public override void ResumeBinding();  // overrides BindingManagerBase
   public override void SuspendBinding();  // overrides BindingManagerBase
// Protected Instance Methods
   protected void CheckEmpty();
   protected internal override string GetListName(
        System.Collections.ArrayList listAccessors);  // overrides BindingManagerBase
   protected internal override void OnCurrentChanged(EventArgs e);  // overrides BindingManagerBase
   protected virtual void OnItemChanged(ItemChangedEventArgs e);
   protected virtual void OnPositionChanged(EventArgs e);
   protected override void UpdateIsBinding();  // overrides BindingManagerBase
// Events
   public event ItemChangedEventHandler ItemChanged;
}

Hierarchy

System.Object BindingManagerBase CurrencyManager

Returned By

ListControl.DataManager

Passed To

DataGridColumnStyle.CheckValidDataSource(), DataGridTableStyle.DataGridTableStyle()

    [ Team LiB ] Previous Section Next Section