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
- DispatchWrapper.cs
- ScrollItemProviderWrapper.cs
- XmlReaderSettings.cs
- RC2.cs
- Invariant.cs
- PermissionAttributes.cs
- ServiceDescriptionData.cs
- PackagePartCollection.cs
- Evidence.cs
- AggregationMinMaxHelpers.cs
- ToolStripSystemRenderer.cs
- oledbconnectionstring.cs
- DataBoundControl.cs
- ComponentResourceKeyConverter.cs
- XmlLanguage.cs
- Application.cs
- BinHexEncoder.cs
- XmlEntityReference.cs
- ReversePositionQuery.cs
- LineMetrics.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ErrorHandler.cs
- FunctionOverloadResolver.cs
- XmlSchemaException.cs
- EntryIndex.cs
- Interlocked.cs
- Column.cs
- SecurityListenerSettingsLifetimeManager.cs
- DetailsViewUpdateEventArgs.cs
- Matrix3D.cs
- CodeAttachEventStatement.cs
- RegexCharClass.cs
- TemplateModeChangedEventArgs.cs
- ObjectAssociationEndMapping.cs
- XPathScanner.cs
- MouseGestureValueSerializer.cs
- Error.cs
- DataGridViewRowsAddedEventArgs.cs
- ProxyElement.cs
- RuntimeVariablesExpression.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- HuffmanTree.cs
- TextTreePropertyUndoUnit.cs
- RegexCaptureCollection.cs
- DataPagerCommandEventArgs.cs
- WebControlToolBoxItem.cs
- DispatcherOperation.cs
- PasswordRecoveryAutoFormat.cs
- DataGridBoolColumn.cs
- NetCodeGroup.cs
- XmlSchemaProviderAttribute.cs
- BitArray.cs
- DispatcherTimer.cs
- Literal.cs
- ResourceBinder.cs
- DashStyles.cs
- StandardOleMarshalObject.cs
- CounterNameConverter.cs
- ConnectionStringEditor.cs
- TypeListConverter.cs
- XpsSerializerFactory.cs
- BamlResourceDeserializer.cs
- IImplicitResourceProvider.cs
- EdmToObjectNamespaceMap.cs
- ListCollectionView.cs
- Int64Converter.cs
- Thread.cs
- WebPartCancelEventArgs.cs
- ToolStripItemClickedEventArgs.cs
- PropertyItem.cs
- EdmItemCollection.cs
- XmlChildEnumerator.cs
- ExpanderAutomationPeer.cs
- DrawingCollection.cs
- sqlnorm.cs
- DeploymentSection.cs
- PrePrepareMethodAttribute.cs
- TypeValidationEventArgs.cs
- PackageDigitalSignatureManager.cs
- ActivityDesignerAccessibleObject.cs
- DataPointer.cs
- PrivilegedConfigurationManager.cs
- CompilationRelaxations.cs
- Matrix.cs
- CharKeyFrameCollection.cs
- XsltConvert.cs
- HwndAppCommandInputProvider.cs
- AnnotationComponentChooser.cs
- GridViewRowEventArgs.cs
- CompModSwitches.cs
- ConfigurationValue.cs
- DocumentViewerBase.cs
- ListViewItem.cs
- GlyphRun.cs
- SoapFault.cs
- JsonUriDataContract.cs
- dataSvcMapFileLoader.cs
- EdmItemCollection.OcAssemblyCache.cs
- SqlBooleanMismatchVisitor.cs
- PolicyLevel.cs