Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / ListManagerBindingsCollection.cs / 1305376 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- followingsibling.cs
- DependencyPropertyConverter.cs
- TimeoutConverter.cs
- DataGridView.cs
- SystemUdpStatistics.cs
- HelpEvent.cs
- GPStream.cs
- RewritingValidator.cs
- RightNameExpirationInfoPair.cs
- Slider.cs
- SqlHelper.cs
- UInt32Converter.cs
- EmissiveMaterial.cs
- EventRecord.cs
- Cursors.cs
- SystemIPGlobalProperties.cs
- MetabaseServerConfig.cs
- KnownColorTable.cs
- SynchronizationContext.cs
- RenderCapability.cs
- DataTemplateKey.cs
- AdapterUtil.cs
- SettingsPropertyIsReadOnlyException.cs
- DataGridViewCell.cs
- TimeIntervalCollection.cs
- KeyboardEventArgs.cs
- ListViewGroup.cs
- UIElementParagraph.cs
- Event.cs
- _BasicClient.cs
- _NTAuthentication.cs
- SingleKeyFrameCollection.cs
- RadioButtonRenderer.cs
- TreeViewImageIndexConverter.cs
- Brush.cs
- Base64Stream.cs
- HierarchicalDataSourceConverter.cs
- TrackBarDesigner.cs
- WebEvents.cs
- Timer.cs
- GroupPartitionExpr.cs
- DbConnectionFactory.cs
- EdmItemCollection.cs
- DataGridViewIntLinkedList.cs
- Annotation.cs
- DataRecordInternal.cs
- GroupQuery.cs
- SQLDecimalStorage.cs
- OutOfMemoryException.cs
- SQLGuidStorage.cs
- XmlEncoding.cs
- CatalogPartCollection.cs
- XmlBufferedByteStreamReader.cs
- MailAddressCollection.cs
- SmiConnection.cs
- SQLResource.cs
- WindowsAuthenticationEventArgs.cs
- GacUtil.cs
- XmlWellformedWriterHelpers.cs
- DbDataReader.cs
- MarkupCompilePass1.cs
- StylusButtonCollection.cs
- ServiceModelPerformanceCounters.cs
- AutomationFocusChangedEventArgs.cs
- ProcessHostFactoryHelper.cs
- Size3DConverter.cs
- LinkButton.cs
- TextEditorDragDrop.cs
- MessageBox.cs
- IChannel.cs
- Base64Encoding.cs
- ZeroOpNode.cs
- WrapperEqualityComparer.cs
- WebEventCodes.cs
- SuppressMessageAttribute.cs
- _HeaderInfoTable.cs
- InvalidEnumArgumentException.cs
- PackagePart.cs
- ChangePasswordDesigner.cs
- HuffModule.cs
- ClientTarget.cs
- DataObjectEventArgs.cs
- SetStateDesigner.cs
- GuidTagList.cs
- CodeTypeReferenceExpression.cs
- CurrentChangedEventManager.cs
- LambdaCompiler.Statements.cs
- SqlClientPermission.cs
- UIPermission.cs
- DefaultBindingPropertyAttribute.cs
- IntegerFacetDescriptionElement.cs
- Sql8ExpressionRewriter.cs
- ListControlBuilder.cs
- PathFigureCollection.cs
- WebPartEditorOkVerb.cs
- ScrollBar.cs
- Int16.cs
- PropertyChangingEventArgs.cs
- ToolStripContentPanel.cs
- BoolExpressionVisitors.cs