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
- DbException.cs
- ExpressionHelper.cs
- NameValueFileSectionHandler.cs
- BrowsableAttribute.cs
- SqlBuilder.cs
- AnnotationComponentChooser.cs
- AttachmentCollection.cs
- BitmapEffectCollection.cs
- DATA_BLOB.cs
- InteropDesigner.xaml.cs
- XmlCountingReader.cs
- SizeConverter.cs
- TableNameAttribute.cs
- TcpHostedTransportConfiguration.cs
- AppSettingsExpressionBuilder.cs
- ConstructorBuilder.cs
- AsyncOperation.cs
- CompiledIdentityConstraint.cs
- InteropTrackingRecord.cs
- InternalConfigConfigurationFactory.cs
- TdsParserSafeHandles.cs
- BrowserDefinitionCollection.cs
- BuilderPropertyEntry.cs
- WebServiceClientProxyGenerator.cs
- CaseCqlBlock.cs
- FunctionMappingTranslator.cs
- InheritanceService.cs
- SpecularMaterial.cs
- MappingSource.cs
- TypedTableBaseExtensions.cs
- AdPostCacheSubstitution.cs
- EastAsianLunisolarCalendar.cs
- Common.cs
- FrameworkReadOnlyPropertyMetadata.cs
- Figure.cs
- ReflectPropertyDescriptor.cs
- Helpers.cs
- nulltextcontainer.cs
- StoreContentChangedEventArgs.cs
- DefaultTraceListener.cs
- DesignerRegionCollection.cs
- SQLMoney.cs
- XmlSchemaInferenceException.cs
- CharacterBuffer.cs
- NotCondition.cs
- HttpGetClientProtocol.cs
- ResXFileRef.cs
- ClickablePoint.cs
- LongValidator.cs
- ComplexLine.cs
- IncrementalReadDecoders.cs
- XmlStringTable.cs
- BypassElementCollection.cs
- ConnectionPoint.cs
- FixedSOMPageElement.cs
- DataGridParentRows.cs
- CompositionCommandSet.cs
- SqlCacheDependencySection.cs
- CodeMethodReturnStatement.cs
- EdmType.cs
- ProvidePropertyAttribute.cs
- UInt16.cs
- PixelShader.cs
- HorizontalAlignConverter.cs
- RIPEMD160Managed.cs
- EventNotify.cs
- RootBrowserWindow.cs
- CaseDesigner.xaml.cs
- TextStore.cs
- Annotation.cs
- SafeNativeMemoryHandle.cs
- SQLChars.cs
- CodeDefaultValueExpression.cs
- SessionPageStateSection.cs
- Quaternion.cs
- Peer.cs
- AxisAngleRotation3D.cs
- BehaviorDragDropEventArgs.cs
- HtmlControl.cs
- DecoratedNameAttribute.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ToolStripLocationCancelEventArgs.cs
- DisplayNameAttribute.cs
- httpapplicationstate.cs
- HitTestResult.cs
- ApplicationBuildProvider.cs
- DeferredElementTreeState.cs
- SqlException.cs
- XmlNullResolver.cs
- ProviderCollection.cs
- Point3DAnimationBase.cs
- ComponentRenameEvent.cs
- EncoderNLS.cs
- MatrixCamera.cs
- HttpWriter.cs
- TextServicesCompartmentEventSink.cs
- WebPartRestoreVerb.cs
- AuthorizationRule.cs
- QilParameter.cs
- TrustManagerPromptUI.cs