BindingContext.ICollection.Count 属性

定义

获取 CurrencyManager 所管理的 BindingContext 对象的总数。Gets the total number of CurrencyManager objects managed by the BindingContext.

property int System::Collections::ICollection::Count { int get(); };
int System.Collections.ICollection.Count { get; }
System.Collections.ICollection.Count
 ReadOnly Property Count As Integer Implements ICollection.Count

属性值

BindingContext 所管理的数据源数。The number of data sources managed by the BindingContext.

实现

示例

下面的代码示例返回 BindingContext管理的 CurrencyManager 对象的数量。The following code example returns the number of CurrencyManager objects managed by the BindingContext.

private:
   void PrintCount()
   {
      Console::WriteLine( "BindingContext->Count {0}",
      ( (ICollection^)(this->BindingContext) )->Count );
   }
private void PrintCount(){
   Console.WriteLine("BindingContext.Count " + ((ICollection) this.BindingContext).Count);
} 
Private Sub PrintCount()
   Console.WriteLine("BindingContext.Count " _
      + CType(Me.BindingContext, ICollection).Count.ToString())
End Sub 

适用于