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
- SqlNodeAnnotation.cs
- DependencyObjectPropertyDescriptor.cs
- TableCellCollection.cs
- InputLanguageProfileNotifySink.cs
- CodeExpressionRuleDeclaration.cs
- MethodToken.cs
- XmlDocument.cs
- WSSecureConversationFeb2005.cs
- AuthenticationService.cs
- DescendantOverDescendantQuery.cs
- ScrollableControl.cs
- SerializationUtility.cs
- NamespaceTable.cs
- ISAPIWorkerRequest.cs
- ContentFileHelper.cs
- XhtmlBasicTextBoxAdapter.cs
- MultiViewDesigner.cs
- TreeNodeMouseHoverEvent.cs
- PeerTransportListenAddressValidator.cs
- WhileDesigner.cs
- ToolStripSplitStackLayout.cs
- AccessViolationException.cs
- LiteralSubsegment.cs
- oledbconnectionstring.cs
- JumpItem.cs
- TypeTypeConverter.cs
- CodeEventReferenceExpression.cs
- Point3DCollectionValueSerializer.cs
- ObjectListComponentEditor.cs
- HttpDictionary.cs
- StringValidatorAttribute.cs
- XmlArrayAttribute.cs
- ConfigurationManagerHelperFactory.cs
- TypeInitializationException.cs
- ChangeProcessor.cs
- ObjectAssociationEndMapping.cs
- FormView.cs
- PageThemeBuildProvider.cs
- NumberSubstitution.cs
- xdrvalidator.cs
- RecognizerBase.cs
- JsonQueryStringConverter.cs
- ListParagraph.cs
- SpellerStatusTable.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- MediaPlayerState.cs
- MouseGestureValueSerializer.cs
- DocumentAutomationPeer.cs
- WmfPlaceableFileHeader.cs
- DrawingBrush.cs
- ParserHooks.cs
- ExpandoClass.cs
- AggregateNode.cs
- ServiceHostFactory.cs
- Filter.cs
- SimpleHandlerFactory.cs
- GroupItem.cs
- cookie.cs
- RequestCache.cs
- AncillaryOps.cs
- regiisutil.cs
- ConvertTextFrag.cs
- VirtualizingStackPanel.cs
- Mouse.cs
- PageAsyncTaskManager.cs
- TableCellAutomationPeer.cs
- Event.cs
- AtomServiceDocumentSerializer.cs
- CustomAssemblyResolver.cs
- DefaultPropertyAttribute.cs
- ConfigurationPermission.cs
- BamlRecords.cs
- DataObjectFieldAttribute.cs
- InfoCardRSACryptoProvider.cs
- BitmapEffectCollection.cs
- TableLayoutCellPaintEventArgs.cs
- Enum.cs
- Action.cs
- PersistenceMetadataNamespace.cs
- ProxyHwnd.cs
- FixedMaxHeap.cs
- XmlDsigSep2000.cs
- bindurihelper.cs
- ObjectItemCollection.cs
- HttpStreams.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- ServicePerformanceCounters.cs
- CDSsyncETWBCLProvider.cs
- SystemIPv6InterfaceProperties.cs
- XmlNode.cs
- ColorTransform.cs
- MemberHolder.cs
- Pens.cs
- CollectionChangeEventArgs.cs
- CompiledRegexRunner.cs
- PrintPreviewDialog.cs
- Enumerable.cs
- TaskFileService.cs
- WrappedReader.cs
- ChangePassword.cs