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
- StylusPointProperties.cs
- Int16.cs
- DecimalAnimationUsingKeyFrames.cs
- RijndaelManagedTransform.cs
- OutputCacheEntry.cs
- KeyInfo.cs
- updateconfighost.cs
- Double.cs
- DataBindingHandlerAttribute.cs
- PointIndependentAnimationStorage.cs
- brushes.cs
- MatrixAnimationUsingKeyFrames.cs
- RsaSecurityKey.cs
- InstanceNameConverter.cs
- StyleReferenceConverter.cs
- ExpressionNode.cs
- SynchronizationContext.cs
- ApplicationFileCodeDomTreeGenerator.cs
- _UncName.cs
- EntityClassGenerator.cs
- XmlILIndex.cs
- TimeManager.cs
- ImageSourceConverter.cs
- DbConnectionPoolOptions.cs
- ExtendedPropertyCollection.cs
- ControlAdapter.cs
- BookmarkNameHelper.cs
- DiagnosticTraceSource.cs
- PageParserFilter.cs
- ToolboxItemAttribute.cs
- RawStylusInputReport.cs
- BooleanConverter.cs
- NonVisualControlAttribute.cs
- EntityClassGenerator.cs
- IndentTextWriter.cs
- SqlDataAdapter.cs
- OptimalTextSource.cs
- ClientSettingsSection.cs
- OleDbRowUpdatingEvent.cs
- ControlValuePropertyAttribute.cs
- SqlDataSourceSummaryPanel.cs
- FrugalMap.cs
- TextInfo.cs
- DataGridViewComboBoxEditingControl.cs
- RoleGroupCollection.cs
- SiteOfOriginPart.cs
- EventPropertyMap.cs
- TheQuery.cs
- IFlowDocumentViewer.cs
- ListViewInsertedEventArgs.cs
- TreeView.cs
- PasswordTextNavigator.cs
- BehaviorEditorPart.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- DataRelation.cs
- PermissionSet.cs
- ApplicationManager.cs
- XamlTreeBuilderBamlRecordWriter.cs
- RenderingEventArgs.cs
- MetadataCollection.cs
- XPathSingletonIterator.cs
- InlineUIContainer.cs
- TextElementEnumerator.cs
- SamlAssertionKeyIdentifierClause.cs
- OletxEnlistment.cs
- ObjectKeyFrameCollection.cs
- Transform3DCollection.cs
- PeerCollaborationPermission.cs
- DrawingContextWalker.cs
- TopClause.cs
- Italic.cs
- ContentElement.cs
- Stroke.cs
- SystemIPInterfaceProperties.cs
- LightweightCodeGenerator.cs
- KeyFrames.cs
- StatusCommandUI.cs
- Parsers.cs
- DesignerActionGlyph.cs
- QueryExpr.cs
- ToggleButton.cs
- BitmapEffectGeneralTransform.cs
- TextAnchor.cs
- PanelDesigner.cs
- AssemblyInfo.cs
- ToolStripStatusLabel.cs
- TypeUtils.cs
- webproxy.cs
- CalendarDay.cs
- DeclaredTypeElement.cs
- AliasGenerator.cs
- RequestCachePolicy.cs
- TextWriter.cs
- WindowsRichEdit.cs
- NoneExcludedImageIndexConverter.cs
- HttpRequest.cs
- ToolBarPanel.cs
- Journal.cs
- ToolStripItemImageRenderEventArgs.cs
- RolePrincipal.cs