Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / DesignConnectionCollection.cs / 2 / DesignConnectionCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Specialized; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; using System.IO; using System.Diagnostics; using System.Globalization; using System.Text.RegularExpressions; namespace System.Data.Design { internal interface IDesignConnectionCollection: INamedObjectCollection { IDesignConnection Get( string name ); void Set( IDesignConnection connection ); void Remove( string name ); void Clear(); } internal class DesignConnectionCollection: DataSourceCollectionBase, IDesignConnectionCollection { internal DesignConnectionCollection(DataSourceComponent collectionHost) : base(collectionHost) { } protected override Type ItemType { get { return typeof(IDesignConnection); } } protected override INameService NameService { get { return SimpleNameService.DefaultInstance; } } // // IDesignConnectionCollection implementation // public IDesignConnection Get( string name ) { return (IDesignConnection) NamedObjectUtil.Find( this, name ); } protected override void OnSet( int index, object oldValue, object newValue ) { base.OnSet( index, oldValue, newValue ); ValidateType( newValue ); IDesignConnection oldConn = (IDesignConnection) oldValue; IDesignConnection newConn = (IDesignConnection) newValue; if( !StringUtil.EqualValue( oldConn.Name, newConn.Name)) { ValidateUniqueName(newConn, newConn.Name); } } public void Set( IDesignConnection connection ) { INamedObject oldConnection = NamedObjectUtil.Find( this, connection.Name ); if( oldConnection != null ) { this.List.Remove( oldConnection ); } this.List.Add( connection ); } public bool Contains( IDesignConnection connection ) { return List.Contains( connection ); } public int Add( IDesignConnection connection ) { return List.Add( connection ); } public void Remove( IDesignConnection connection ) { List.Remove( connection ); } } } // 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
- FindProgressChangedEventArgs.cs
- UnsafeNativeMethods.cs
- ColorIndependentAnimationStorage.cs
- IInstanceTable.cs
- XmlWrappingReader.cs
- ShapeTypeface.cs
- ActionMismatchAddressingException.cs
- TargetParameterCountException.cs
- AuthenticationConfig.cs
- DeviceFilterDictionary.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- HwndMouseInputProvider.cs
- WindowsGraphicsCacheManager.cs
- NamespaceExpr.cs
- ToolStripSplitButton.cs
- MLangCodePageEncoding.cs
- CodeThrowExceptionStatement.cs
- ToolStripSeparatorRenderEventArgs.cs
- CompositeControl.cs
- View.cs
- TextViewBase.cs
- NullReferenceException.cs
- TextAdaptor.cs
- DispatcherFrame.cs
- FormsAuthenticationCredentials.cs
- MSAANativeProvider.cs
- SecurityDocument.cs
- XmlChoiceIdentifierAttribute.cs
- BamlLocalizationDictionary.cs
- ManageRequest.cs
- QilNode.cs
- XPathAncestorIterator.cs
- SqlFileStream.cs
- cookiecontainer.cs
- TextServicesDisplayAttributePropertyRanges.cs
- EventlogProvider.cs
- SHA512Managed.cs
- InputScopeAttribute.cs
- ResourceManagerWrapper.cs
- MultiView.cs
- TreeViewItem.cs
- HTTPAPI_VERSION.cs
- Opcode.cs
- MergeEnumerator.cs
- IPHostEntry.cs
- RowTypeElement.cs
- SqlFunctionAttribute.cs
- ControlPropertyNameConverter.cs
- UiaCoreProviderApi.cs
- Internal.cs
- HostedImpersonationContext.cs
- HandledEventArgs.cs
- CodeTypeReferenceCollection.cs
- ResetableIterator.cs
- JavaScriptSerializer.cs
- ToolstripProfessionalRenderer.cs
- AutomationPeer.cs
- SelfIssuedAuthProofToken.cs
- SmiGettersStream.cs
- InvalidPrinterException.cs
- LongTypeConverter.cs
- EventLogger.cs
- EdgeProfileValidation.cs
- XPathNodeInfoAtom.cs
- DataGridViewHeaderCell.cs
- AncestorChangedEventArgs.cs
- SinglePageViewer.cs
- ManualResetEvent.cs
- DataObjectMethodAttribute.cs
- ResourcePermissionBaseEntry.cs
- DiscriminatorMap.cs
- TargetException.cs
- DebuggerAttributes.cs
- ParallelLoopState.cs
- ScriptManager.cs
- ObjectQuery_EntitySqlExtensions.cs
- SpotLight.cs
- TextPenaltyModule.cs
- SafePEFileHandle.cs
- StringOutput.cs
- QuestionEventArgs.cs
- AdapterSwitches.cs
- RegexTree.cs
- ListViewItem.cs
- CodeDomComponentSerializationService.cs
- AggregatePushdown.cs
- HttpContext.cs
- Compiler.cs
- WebPartConnectionsEventArgs.cs
- CodeCommentStatementCollection.cs
- PartEditor.cs
- ReadOnlyCollection.cs
- SimpleTypeResolver.cs
- SingleTagSectionHandler.cs
- XmlILTrace.cs
- ConvertersCollection.cs
- TextShapeableCharacters.cs
- CodeTypeDelegate.cs
- DataTableNewRowEvent.cs
- MissingMemberException.cs