Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / ListManagerBindingsCollection.cs / 1 / ListManagerBindingsCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System;
using Microsoft.Win32;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections;
///
///
/// BindingsCollection is a collection of bindings for a Control. It has Add/Remove capabilities,
/// as well as an All array property, enumeration, etc.
///
[DefaultEvent("CollectionChanged")]
internal class ListManagerBindingsCollection : BindingsCollection {
private BindingManagerBase bindingManagerBase;
///
///
/// ColumnsCollection constructor. Used only by DataSource.
///
internal ListManagerBindingsCollection(BindingManagerBase bindingManagerBase) : base() {
Debug.Assert(bindingManagerBase != null, "How could a listmanagerbindingscollection not have a bindingManagerBase associated with it!");
this.bindingManagerBase = bindingManagerBase;
}
protected override void AddCore(Binding dataBinding) {
if (dataBinding == null)
throw new ArgumentNullException("dataBinding");
if (dataBinding.BindingManagerBase == bindingManagerBase)
throw new ArgumentException(SR.GetString(SR.BindingsCollectionAdd1), "dataBinding");
if (dataBinding.BindingManagerBase != null)
throw new ArgumentException(SR.GetString(SR.BindingsCollectionAdd2), "dataBinding");
// important to set prop first for error checking.
dataBinding.SetListManager(bindingManagerBase);
base.AddCore(dataBinding);
}
protected override void ClearCore() {
int numLinks = Count;
for (int i = 0; i < numLinks; i++) {
Binding dataBinding = this[i];
dataBinding.SetListManager(null);
}
base.ClearCore();
}
protected override void RemoveCore(Binding dataBinding) {
if (dataBinding.BindingManagerBase != bindingManagerBase)
throw new ArgumentException(SR.GetString(SR.BindingsCollectionForeign));
dataBinding.SetListManager(null);
base.RemoveCore(dataBinding);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CfgSemanticTag.cs
- CodeDOMProvider.cs
- SequentialOutput.cs
- ApplicationContext.cs
- TemplateBuilder.cs
- CodeMethodInvokeExpression.cs
- ConfigXmlComment.cs
- DataServiceRequest.cs
- Transform3D.cs
- AutomationIdentifier.cs
- LinqMaximalSubtreeNominator.cs
- ManifestSignedXml.cs
- DataGridAddNewRow.cs
- TextTreeUndo.cs
- BCLDebug.cs
- StoreContentChangedEventArgs.cs
- StyleModeStack.cs
- SqlCacheDependencyDatabase.cs
- QueueProcessor.cs
- MD5CryptoServiceProvider.cs
- DataGridColumnReorderingEventArgs.cs
- UserMapPath.cs
- ServiceModelReg.cs
- ItemsPanelTemplate.cs
- DeferredReference.cs
- RecognizedWordUnit.cs
- LogicalCallContext.cs
- EFTableProvider.cs
- SmtpMail.cs
- MatrixUtil.cs
- SettingsProviderCollection.cs
- EditorZoneBase.cs
- Control.cs
- OleDbConnectionInternal.cs
- NamespaceDecl.cs
- FlowDocumentReader.cs
- MobilePage.cs
- RestHandlerFactory.cs
- Base64Decoder.cs
- TransformGroup.cs
- X509PeerCertificateAuthentication.cs
- Publisher.cs
- DoubleStorage.cs
- ExpandCollapseIsCheckedConverter.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- PathData.cs
- MouseOverProperty.cs
- CompositionCommandSet.cs
- ProvidePropertyAttribute.cs
- MasterPageBuildProvider.cs
- TreeViewCancelEvent.cs
- ValidationHelpers.cs
- ServicePointManager.cs
- DescendentsWalkerBase.cs
- FixedFlowMap.cs
- GeneralTransform3DGroup.cs
- IdentityModelDictionary.cs
- COM2ExtendedTypeConverter.cs
- CommandLineParser.cs
- SHA384.cs
- EventPrivateKey.cs
- DynamicILGenerator.cs
- EDesignUtil.cs
- InputScope.cs
- CssStyleCollection.cs
- Buffer.cs
- ImageAnimator.cs
- xdrvalidator.cs
- SymDocumentType.cs
- WebHostedComPlusServiceHost.cs
- AttributeData.cs
- ErrorCodes.cs
- UpdatePanelTriggerCollection.cs
- ServiceElementCollection.cs
- GeneralTransform3DGroup.cs
- CompositionAdorner.cs
- NativeMethods.cs
- TargetConverter.cs
- ObjectDisposedException.cs
- SegmentTree.cs
- cookiecontainer.cs
- KeyedQueue.cs
- RelativeSource.cs
- NullableDoubleSumAggregationOperator.cs
- DataGridViewRowEventArgs.cs
- RichTextBox.cs
- Utility.cs
- StyleSelector.cs
- XsltException.cs
- ConfigXmlReader.cs
- NotificationContext.cs
- OutputCacheSection.cs
- _Rfc2616CacheValidators.cs
- PropVariant.cs
- BaseAsyncResult.cs
- CellTreeNode.cs
- InvalidCastException.cs
- ConnectionManagementElementCollection.cs
- StylusDevice.cs
- LingerOption.cs