BindingSource 类

定义

封装窗体的数据源。Encapsulates the data source for a form.

public ref class BindingSource : System::ComponentModel::Component, System::Collections::IList, System::ComponentModel::IBindingListView, System::ComponentModel::ICancelAddNew, System::ComponentModel::ISupportInitializeNotification, System::ComponentModel::ITypedList, System::Windows::Forms::ICurrencyManagerProvider
[System.ComponentModel.ComplexBindingProperties("DataSource", "DataMember")]
public class BindingSource : System.ComponentModel.Component, System.Collections.IList, System.ComponentModel.IBindingListView, System.ComponentModel.ICancelAddNew, System.ComponentModel.ISupportInitializeNotification, System.ComponentModel.ITypedList, System.Windows.Forms.ICurrencyManagerProvider
type BindingSource = class
    inherit Component
    interface IBindingListView
    interface IBindingList
    interface IList
    interface ICollection
    interface IEnumerable
    interface ITypedList
    interface ICancelAddNew
    interface ISupportInitializeNotification
    interface ISupportInitialize
    interface ICurrencyManagerProvider
Public Class BindingSource
Inherits Component
Implements IBindingListView, ICancelAddNew, ICurrencyManagerProvider, IList, ISupportInitializeNotification, ITypedList
继承
属性
实现

示例

下面的代码示例演示ListBox绑定到的。 BindingSourceThe following code example demonstrates a ListBox bound to a BindingSource. BindingSource 绑定BindingList<T>到包含字体列表的。The BindingSource is bound to a BindingList<T> that contains a list of fonts.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BindingSourceExamples
{
    public class Form1 : Form
    {
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new Form1());
        }

        public Form1()
        {
            this.Load += new EventHandler(Form1_Load);
        }

        private TextBox textBox1;
        private Button button1;
        private ListBox listBox1;
       
        private BindingSource binding1;
        void Form1_Load(object sender, EventArgs e)
        {
            listBox1 = new ListBox();
            textBox1 = new TextBox();
            binding1 = new BindingSource();
            button1 = new Button();
            listBox1.Location = new Point(140, 25);
            listBox1.Size = new Size(123, 160);
            textBox1.Location = new Point(23, 70);
            textBox1.Size = new Size(100, 20);
            textBox1.Text = "Wingdings";
            button1.Location = new Point(23, 25);
            button1.Size = new Size(75, 23);
            button1.Text = "Search";
            button1.Click += new EventHandler(this.button1_Click);
            this.ClientSize = new Size(292, 266);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.listBox1);

            MyFontList fonts = new MyFontList();
            for (int i = 0; i < FontFamily.Families.Length; i++)
            {
                if (FontFamily.Families[i].IsStyleAvailable(FontStyle.Regular))
                    fonts.Add(new Font(FontFamily.Families[i], 11.0F, FontStyle.Regular));
            }
            binding1.DataSource = fonts;
            listBox1.DataSource = binding1;
            listBox1.DisplayMember = "Name";

        }

  
        private void button1_Click(object sender, EventArgs e)
        {
            if (binding1.SupportsSearching != true)
                MessageBox.Show("Cannot search the list.");
            else
            {
                int foundIndex = binding1.Find("Name", textBox1.Text);
                if (foundIndex > -1)
                    listBox1.SelectedIndex = foundIndex;
                else
                    MessageBox.Show("Font was not found.");
            }
        }
    }
    
    public class MyFontList : BindingList<Font>
    {

        protected override bool SupportsSearchingCore
        {
            get { return true; }
        }
        protected override int FindCore(PropertyDescriptor prop, object key)
        {
            // Ignore the prop value and search by family name.
            for (int i = 0; i < Count; ++i)
            {
                if (Items[i].FontFamily.Name.ToLower() == ((string)key).ToLower())
                    return i;

            }
            return -1;
        }


    }
  
}
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Public Class Form1
    Inherits Form

    <STAThread()> _
    Shared Sub Main()
        Application.EnableVisualStyles()
        Application.Run(New Form1())

    End Sub

    Public Sub New()

    End Sub

    Private textBox1 As TextBox
    Private WithEvents button1 As Button
    Private listBox1 As ListBox
    Private components As IContainer
    Private binding1 As BindingSource

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        listBox1 = New ListBox()
        textBox1 = New TextBox()
        binding1 = New BindingSource()
        button1 = New Button()
        listBox1.Location = New Point(140, 25)
        listBox1.Size = New Size(123, 160)
        textBox1.Location = New Point(23, 70)
        textBox1.Size = New Size(100, 20)
        textBox1.Text = "Wingdings"
        button1.Location = New Point(23, 25)
        button1.Size = New Size(75, 23)
        button1.Text = "Search"
        Me.ClientSize = New Size(292, 266)
        Me.Controls.Add(Me.button1)
        Me.Controls.Add(Me.textBox1)
        Me.Controls.Add(Me.listBox1)

        Dim fonts As New MyFontList()
        Dim i As Integer
        For i = 0 To FontFamily.Families.Length - 1
            If FontFamily.Families(i).IsStyleAvailable(FontStyle.Regular) Then
                fonts.Add(New Font(FontFamily.Families(i), 11.0F, FontStyle.Regular))
            End If
        Next i
        binding1.DataSource = fonts
        listBox1.DataSource = binding1
        listBox1.DisplayMember = "Name"

    End Sub
    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
        Handles button1.Click

        If binding1.SupportsSearching <> True Then
            MessageBox.Show("Cannot search the list.")
        Else
            Dim foundIndex As Integer = binding1.Find("Name", textBox1.Text)
            If foundIndex > -1 Then
                listBox1.SelectedIndex = foundIndex
            Else
                MessageBox.Show("Font was not found.")
            End If
        End If

    End Sub
End Class

Public Class MyFontList
    Inherits BindingList(Of Font)

    Protected Overrides ReadOnly Property SupportsSearchingCore() As Boolean
        Get
            Return True
        End Get
    End Property
    
    Protected Overrides Function FindCore(ByVal prop As PropertyDescriptor, _
        ByVal key As Object) As Integer
        ' Ignore the prop value and search by family name.
        Dim i As Integer
        While i < Count
            If Items(i).FontFamily.Name.ToLower() = CStr(key).ToLower() Then
                Return i
            End If
            i += 1
        End While

        Return -1
    End Function
End Class

注解

BindingSource组件提供多种用途。The BindingSource component serves many purposes. 首先, 通过在 Windows 窗体控件和数据源之间提供货币管理、更改通知和其他服务, 简化了窗体上的控件与数据的绑定。First, it simplifies binding controls on a form to data by providing currency management, change notification, and other services between Windows Forms controls and data sources. 这是通过DataSource使用属性将BindingSource组件附加到数据源来实现的。This is accomplished by attaching the BindingSource component to your data source using the DataSource property. 对于复杂的绑定方案, 可以选择将DataMember属性设置为数据源中的特定列或列表。For complex binding scenarios you can optionally set the DataMember property to a specific column or list in the data source. 然后, 将控件绑定到BindingSourceYou then bind controls to the BindingSource. 与数据的所有进一步交互都是通过调用BindingSource组件来完成的。All further interaction with the data is accomplished with calls to the BindingSource component. 有关如何BindingSource可以简化绑定过程的示例, 请参阅如何:将 Windows 窗体控件绑定到 DBNull 数据库以及如何:处理数据绑定时出现的错误和异常。For examples on how the BindingSource can simplify the binding process, see How to: Bind Windows Forms Controls to DBNull Database Values and How to: Handle Errors and Exceptions that Occur with Databinding. 通过MoveNextMoveLast和等方法完成数据源的导航和更新。RemoveNavigation and updating of the data source is accomplished through methods such as MoveNext, MoveLast, and Remove. 排序和筛选等操作通过SortFilter属性进行处理。Operations such as sorting and filtering are handled through the Sort and Filter properties. 有关将BindingSource排序和筛选用于的详细信息, 请参阅如何:用 Windows 窗体 BindingSource 组件对数据进行排序和筛选。For more information on using sorting and filtering with the BindingSource, see How to: Sort and Filter ADO.NET Data with the Windows Forms BindingSource Component.

此外, 该BindingSource组件可以充当强类型的数据源。In addition, the BindingSource component can act as a strongly typed data source. 通常, 基础数据源的类型是通过以下机制之一固定的:Typically the type of the underlying data source is fixed through one of the following mechanisms:

这两种机制都创建强类型列表。Both of these mechanisms create a strongly-typed list. 有关如何使用BindingSource绑定到类型的详细信息, 请参阅如何:将 Windows 窗体控件绑定到类型For more information on how to use the BindingSource to bind to a type, see How to: Bind a Windows Forms Control to a Type. 你还可以使用BindingSource将控件绑定到工厂对象。You can also use the BindingSource to bind your controls to a factory object. 有关如何执行此操作的详细信息, 请参阅如何:将 Windows 窗体控件绑定到工厂对象For more information on how to do this, see How to: Bind a Windows Forms Control to a Factory Object.

备注

BindingSource由于处理简单数据源和复杂数据源, 术语会出现问题。Because a BindingSource handles both simple and complex data sources, terminology is problematic. 在此类文档中, 术语 "列表" 指的是托管数据源中的数据集合, "" 表示单个元素。Within this class documentation, the term list refers to a data collection within the hosted data source, and item denotes a single element. 讨论与复杂数据源关联的功能时, 将使用等效术语When discussing functionality associated with complex data sources, the equivalent terms table and row are used.

BindingSource提供用于访问基础数据的成员。BindingSource provides members for accessing the underlying data. 可以通过Current属性检索当前项, 并且可以List通过属性检索整个列表。The current item can be retrieved through the Current property, and the entire list can be retrieved through the List property. Current当前项通过RemoveCurrent和、 EndEditCancelEdit和方法支持编辑AddNew操作。 AddEditing operations are supported on the current item through Current and the RemoveCurrent, EndEdit, CancelEdit and Add and AddNew methods. 尽管自动为所有基础数据源类型处理币种管理, 但此类公开了许多允许自定义的事件CurrentItemChanged , DataSourceChanged例如和。Although currency management is handled automatically for all underlying data source types, this class exposes a number of events, such as CurrentItemChanged and DataSourceChanged, that allow for customization.

绑定到BindingSource组件的数据源还可以BindingNavigator使用类进行导航和管理, 该类提供类似 VCR 的用户界面 (UI) 用于在列表中导航项。Data sources that are bound to a BindingSource component can also be navigated and managed with the BindingNavigator class, which provides a VCR-like user interface (UI) for navigating items within a list. 尽管BindingNavigator可以绑定到任何数据源, 但它旨在通过其BindingNavigator.BindingSource属性BindingSource与组件集成。Although BindingNavigator can be bound to any data source, it was designed to integrate with a BindingSource component through its BindingNavigator.BindingSource property.

BindingSource类的默认属性为DataSourceThe default property for the BindingSource class is DataSource. 默认事件为CurrentChangedThe default event is CurrentChanged.

注意

BindingSource类的许多成员对List由属性表示的基础列表进行操作, 只是将其操作引用到基础列表。Many of the members of the BindingSource class operate on the underlying list represented by the List property and simply refer their operation to the underlying list. 因此, 当绑定BindingSource到的自定义IList实现时, 这些成员的确切行为可能与类文档中所述的行为不同。Therefore, when the BindingSource is bound to a custom implementation of IList, the exact behavior of these members may differ from the behavior described in the class documentation. 例如, RemoveAt方法调用IList.RemoveAtFor example, the RemoveAt method calls IList.RemoveAt. 本文档介绍方法, RemoveAt并了解底层IList的方法是否正确实现。 RemoveAt BindingSourceThe BindingSource documentation describes the RemoveAt method with the understanding that the RemoveAt method for the underlying IList is correctly implemented.

构造函数

BindingSource()

BindingSource 类的新实例初始化为默认属性值。Initializes a new instance of the BindingSource class to the default property values.

BindingSource(IContainer)

初始化 BindingSource 类的新实例,并将 BindingSource 添加到指定的容器。Initializes a new instance of the BindingSource class and adds the BindingSource to the specified container.

BindingSource(Object, String)

用指定的数据源和数据成员初始化 BindingSource 类的新实例。Initializes a new instance of the BindingSource class with the specified data source and data member.

属性

AllowEdit

获取一个值,该值指示是否可以编辑基础列表中的项。Gets a value indicating whether items in the underlying list can be edited.

AllowNew

获取或设置一个值,该值指示是否可以使用 AddNew() 方法向列表中添加项。Gets or sets a value indicating whether the AddNew() method can be used to add items to the list.

AllowRemove

获取一个值,它指示是否可从基础列表中移除项。Gets a value indicating whether items can be removed from the underlying list.

CanRaiseEvents

获取一个指示组件是否可以引发事件的值。Gets a value indicating whether the component can raise an event.

(继承自 Component)
Container

获取 IContainer,它包含 ComponentGets the IContainer that contains the Component.

(继承自 Component)
Count

获取在的基础列表中项的总数。获取在基础列表中项的总数,考虑当前 Filter 值。Gets the total number of items in the underlying list, taking the current Filter value into consideration.

CurrencyManager

获取与此 BindingSource 关联的当前项管理器。Gets the currency manager associated with this BindingSource.

Current

获取列表中的当前项。Gets the current item in the list.

DataMember

获取或设置连接器当前绑定到的数据源中的特定列表。Gets or sets the specific list in the data source to which the connector currently binds to.

DataSource

获取或设置连接器绑定到的数据源。Gets or sets the data source that the connector binds to.

DesignMode

获取一个值,用以指示 Component 当前是否处于设计模式。Gets a value that indicates whether the Component is currently in design mode.

(继承自 Component)
Events

获取附加到此 Component 的事件处理程序的列表。Gets the list of event handlers that are attached to this Component.

(继承自 Component)
Filter

获取或设置用于筛选查看哪些行的表达式。Gets or sets the expression used to filter which rows are viewed.

IsBindingSuspended

获取一个值,该值指示列表绑定是否已挂起。Gets a value indicating whether the list binding is suspended.

IsFixedSize

获取一个值,该值指示基础列表是否具有固定大小。Gets a value indicating whether the underlying list has a fixed size.

IsReadOnly

获取一个值,该值指示基础列表是否为只读。Gets a value indicating whether the underlying list is read-only.

IsSorted

获取一个值,该值指示是否可以对基础列表中的项排序。Gets a value indicating whether the items in the underlying list are sorted.

IsSynchronized

获取一个值,该值指示对集合的访问是否为同步的(线程安全)。Gets a value indicating whether access to the collection is synchronized (thread safe).

Item[Int32]

获取或设置指定索引处的列表元素。Gets or sets the list element at the specified index.

List

获取连接器绑定到的列表。Gets the list that the connector is bound to.

Position

获取或设置基础列表中当前项的索引。Gets or sets the index of the current item in the underlying list.

RaiseListChangedEvents

获取或设置一个值,该值指示是否应引发 ListChanged 事件。Gets or sets a value indicating whether ListChanged events should be raised.

Site

获取或设置 ComponentISiteGets or sets the ISite of the Component.

(继承自 Component)
Sort

获取或设置用于排序的列名称以及用于查看数据源中的行的排序顺序。Gets or sets the column names used for sorting, and the sort order for viewing the rows in the data source.

SortDescriptions

获取应用于数据源的排序说明的集合。Gets the collection of sort descriptions applied to the data source.

SortDirection

获取列表中项的排序方向。Gets the direction the items in the list are sorted.

SortProperty

获取正在用于对列表进行排序的 PropertyDescriptorGets the PropertyDescriptor that is being used for sorting the list.

SupportsAdvancedSorting

获取一个值,它指示数据源是否支持多列排序。Gets a value indicating whether the data source supports multi-column sorting.

SupportsChangeNotification

获取一个值,它指示数据源是否支持更改通知。Gets a value indicating whether the data source supports change notification.

SupportsFiltering

获取一个值,该值指示数据源是否支持筛选。Gets a value indicating whether the data source supports filtering.

SupportsSearching

获取一个值,它指示数据源是否支持使用 Find(PropertyDescriptor, Object) 方法进行搜索。Gets a value indicating whether the data source supports searching with the Find(PropertyDescriptor, Object) method.

SupportsSorting

获取一个值,它指示数据源是否支持排序。Gets a value indicating whether the data source supports sorting.

SyncRoot

获取可用于同步对基础列表的访问的对象。Gets an object that can be used to synchronize access to the underlying list.

方法

Add(Object)

将现有项添加到内部列表中。Adds an existing item to the internal list.

AddNew()

在基础列表中添加一个新项。Adds a new item to the underlying list.

ApplySort(ListSortDescriptionCollection)

使用指定的排序说明对数据源进行排序。Sorts the data source with the specified sort descriptions.

ApplySort(PropertyDescriptor, ListSortDirection)

使用指定的属性说明符和排序方向对数据源进行排序。Sorts the data source using the specified property descriptor and sort direction.

CancelEdit()

取消当前的编辑操作。Cancels the current edit operation.

Clear()

从列表中移除所有元素。Removes all elements from the list.

Contains(Object)

确定某个对象是否为列表中的项。Determines whether an object is an item in the list.

CopyTo(Array, Int32)

List 中的内容复制到指定数组,从指定索引值处开始。Copies the contents of the List to the specified array, starting at the specified index value.

CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(继承自 MarshalByRefObject)
Dispose()

释放由 Component 使用的所有资源。Releases all resources used by the Component.

(继承自 Component)
Dispose(Boolean)

释放由 BindingSource 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the BindingSource and optionally releases the managed resources.

EndEdit()

将挂起的更改应用于基础数据源。Applies pending changes to the underlying data source.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
Find(PropertyDescriptor, Object)

搜索具有指定属性描述符的项索引。Searches for the index of the item that has the given property descriptor.

Find(String, Object)

使用指定的属性名和值返回列表中的项的索引。Returns the index of the item in the list with the specified property name and value.

GetEnumerator()

检索 List 的一个枚举数。Retrieves an enumerator for the List.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetItemProperties(PropertyDescriptor[])

检索表示数据源列表类型的可绑定属性的 PropertyDescriptor 对象的数组。Retrieves an array of PropertyDescriptor objects representing the bindable properties of the data source list type.

GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(继承自 MarshalByRefObject)
GetListName(PropertyDescriptor[])

获取为绑定提供数据的列表的名称。Gets the name of the list supplying data for the binding.

GetRelatedCurrencyManager(String)

为指定的数据成员获取相关的当前项管理器。Gets the related currency manager for the specified data member.

GetService(Type)

返回一个对象,该对象表示由 Component 或它的 Container 提供的服务。Returns an object that represents a service provided by the Component or by its Container.

(继承自 Component)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
IndexOf(Object)

搜索指定的对象,并返回整个列表中第一个匹配项的索引。Searches for the specified object and returns the index of the first occurrence within the entire list.

InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(继承自 MarshalByRefObject)
Insert(Int32, Object)

将一项插入列表中指定的索引处。Inserts an item into the list at the specified index.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(继承自 MarshalByRefObject)
MoveFirst()

移至列表中的第一项。Moves to the first item in the list.

MoveLast()

移至列表中的最后一项。Moves to the last item in the list.

MoveNext()

移至列表中的下一项。Moves to the next item in the list.

MovePrevious()

移至列表中的上一项。Moves to the previous item in the list.

OnAddingNew(AddingNewEventArgs)

引发 AddingNew 事件。Raises the AddingNew event.

OnBindingComplete(BindingCompleteEventArgs)

引发 BindingComplete 事件。Raises the BindingComplete event.

OnCurrentChanged(EventArgs)

引发 CurrentChanged 事件。Raises the CurrentChanged event.

OnCurrentItemChanged(EventArgs)

引发 CurrentItemChanged 事件。Raises the CurrentItemChanged event.

OnDataError(BindingManagerDataErrorEventArgs)

引发 DataError 事件。Raises the DataError event.

OnDataMemberChanged(EventArgs)

引发 DataMemberChanged 事件。Raises the DataMemberChanged event.

OnDataSourceChanged(EventArgs)

引发 DataSourceChanged 事件。Raises the DataSourceChanged event.

OnListChanged(ListChangedEventArgs)

引发 ListChanged 事件。Raises the ListChanged event.

OnPositionChanged(EventArgs)

引发 PositionChanged 事件。Raises the PositionChanged event.

Remove(Object)

从列表中移除指定的项。Removes the specified item from the list.

RemoveAt(Int32)

移除此列表中指定索引处的项。Removes the item at the specified index in the list.

RemoveCurrent()

从列表中移除当前项。Removes the current item from the list.

RemoveFilter()

移除与 BindingSource 关联的筛选器。Removes the filter associated with the BindingSource.

RemoveSort()

移除与 BindingSource 关联的排序。Removes the sort associated with the BindingSource.

ResetAllowNew()

重新初始化 AllowNew 属性。Reinitializes the AllowNew property.

ResetBindings(Boolean)

使绑定到 BindingSource 的控件重新读取列表中的所有项,并刷新这些项的显示值。Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values.

ResetCurrentItem()

使绑定到 BindingSource 的控件重新读取当前选定的项,并刷新其显示值。Causes a control bound to the BindingSource to reread the currently selected item and refresh its displayed value.

ResetItem(Int32)

使绑定到 BindingSource 的控件重新读取指定索引处的项,并刷新其显示值。Causes a control bound to the BindingSource to reread the item at the specified index, and refresh its displayed value.

ResumeBinding()

继续数据绑定。Resumes data binding.

SuspendBinding()

挂起数据绑定,以阻止使用所做的更改对绑定数据源进行更新。Suspends data binding to prevent changes from updating the bound data source.

ToString()

返回包含 Component 的名称的 String(如果有)。Returns a String containing the name of the Component, if any. 不应重写此方法。This method should not be overridden.

(继承自 Component)

事件

AddingNew

在将项添加到基础列表之前发生。Occurs before an item is added to the underlying list.

BindingComplete

当所有客户端都已绑定到此 BindingSource 时发生。Occurs when all the clients have been bound to this BindingSource.

CurrentChanged

在当前绑定项更改时发生。Occurs when the currently bound item changes.

CurrentItemChanged

Current 属性的属性值更改后发生。Occurs when a property value of the Current property has changed.

DataError

当货币相关的异常由 BindingSource 无提示处理时发生。Occurs when a currency-related exception is silently handled by the BindingSource.

DataMemberChanged

DataMember 属性值更改后发生。Occurs when the DataMember property value has changed.

DataSourceChanged

DataSource 属性值更改后发生。Occurs when the DataSource property value has changed.

Disposed

当通过调用 Dispose() 方法释放组件时发生。Occurs when the component is disposed by a call to the Dispose() method.

(继承自 Component)
ListChanged

当基础列表更改或列表中的项更改时发生。Occurs when the underlying list changes or an item in the list changes.

PositionChanged

Position 属性的值更改后发生。Occurs after the value of the Position property has changed.

显式界面实现

IBindingList.AddIndex(PropertyDescriptor)

PropertyDescriptor 添加到用于搜索的索引。Adds the PropertyDescriptor to the indexes used for searching.

IBindingList.RemoveIndex(PropertyDescriptor)

PropertyDescriptor 从用于搜索的索引中移除。Removes the PropertyDescriptor from the indexes used for searching.

ICancelAddNew.CancelNew(Int32)

丢弃集合中挂起的新项。Discards a pending new item from the collection.

ICancelAddNew.EndNew(Int32)

向集合提交挂起的新项。Commits a pending new item to the collection.

ISupportInitialize.BeginInit()

用信号通知 BindingSource 初始化即将开始。Signals the BindingSource that initialization is starting.

ISupportInitialize.EndInit()

用信号通知 BindingSource 初始化已完成。Signals the BindingSource that initialization is complete.

ISupportInitializeNotification.Initialized

初始化 BindingSource 时出现。Occurs when the BindingSource is initialized.

ISupportInitializeNotification.IsInitialized

获取一个值,该值指示是否初始化 BindingSourceGets a value indicating whether the BindingSource is initialized.

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅