Code:
/ FX-1434 / FX-1434 / 1.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
- WpfXamlType.cs
- StringDictionary.cs
- ValidationErrorEventArgs.cs
- MimeBasePart.cs
- BitmapEffectInput.cs
- AddingNewEventArgs.cs
- InvalidPrinterException.cs
- AppDomainUnloadedException.cs
- JournalEntryListConverter.cs
- ProfileModule.cs
- RegularExpressionValidator.cs
- WebRequestModulesSection.cs
- NativeMethods.cs
- TableItemPatternIdentifiers.cs
- PropertyChangedEventManager.cs
- FlowDocumentReaderAutomationPeer.cs
- hwndwrapper.cs
- InputProcessorProfilesLoader.cs
- SequenceDesigner.xaml.cs
- DesignTimeTemplateParser.cs
- NegotiateStream.cs
- DBNull.cs
- WSFederationHttpBindingCollectionElement.cs
- LicenseManager.cs
- BaseParagraph.cs
- TranslateTransform.cs
- MappingSource.cs
- GradientBrush.cs
- UdpChannelFactory.cs
- Menu.cs
- ListControlConvertEventArgs.cs
- figurelengthconverter.cs
- ConditionalAttribute.cs
- EntityDataSourceDataSelectionPanel.cs
- _NativeSSPI.cs
- GregorianCalendarHelper.cs
- XmlDataProvider.cs
- cookie.cs
- DesignerTransactionCloseEvent.cs
- BinaryReader.cs
- Margins.cs
- SQLByteStorage.cs
- CodeDirectoryCompiler.cs
- SynchronizationHandlesCodeDomSerializer.cs
- GroupDescription.cs
- CharAnimationBase.cs
- FileNameEditor.cs
- ErrorRuntimeConfig.cs
- DBConnection.cs
- WindowsFont.cs
- HttpAsyncResult.cs
- QuadraticBezierSegment.cs
- SqlDataSourceEnumerator.cs
- Decorator.cs
- DataGridCellEditEndingEventArgs.cs
- MetadataArtifactLoaderCompositeResource.cs
- BreakSafeBase.cs
- PointLightBase.cs
- WebServiceReceiveDesigner.cs
- HttpProtocolImporter.cs
- UserMapPath.cs
- AppendHelper.cs
- XhtmlTextWriter.cs
- GraphicsState.cs
- ADConnectionHelper.cs
- VirtualPathUtility.cs
- Thickness.cs
- objectresult_tresulttype.cs
- RouteItem.cs
- TextDecoration.cs
- Pkcs7Recipient.cs
- Vector3DValueSerializer.cs
- EncryptedReference.cs
- FontWeights.cs
- Validator.cs
- DataColumnPropertyDescriptor.cs
- DesignerSerializerAttribute.cs
- DesignerExtenders.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- AssemblyNameProxy.cs
- IndexerNameAttribute.cs
- IssuedTokenServiceCredential.cs
- SamlAuthenticationStatement.cs
- NetSectionGroup.cs
- entitydatasourceentitysetnameconverter.cs
- SystemInfo.cs
- UnsafeNativeMethods.cs
- MethodBody.cs
- QilLiteral.cs
- EntityDataSourceEntityTypeFilterItem.cs
- ByteConverter.cs
- SingleConverter.cs
- FixedDocumentPaginator.cs
- TypeSystemProvider.cs
- PagerSettings.cs
- DataGridViewSelectedRowCollection.cs
- RijndaelManaged.cs
- NetworkInformationPermission.cs
- designeractionbehavior.cs
- TextViewBase.cs