Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / DbSourceParameterCollection.cs / 2 / DbSourceParameterCollection.cs
namespace System.Data.Design { using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.Common; using System.Diagnostics; using System.Globalization; internal class DbSourceParameterCollection : DataSourceCollectionBase, IDataParameterCollection, ICloneable { internal DbSourceParameterCollection(DataSourceComponent collectionHost) : base(collectionHost){} ////// ///protected override INameService NameService { get { return SimpleNameService.DefaultInstance; } } // explicit IDataParameterCollection implementation object IDataParameterCollection.this[string parameterName] { get { int index = RangeCheck( parameterName ); return this.List[index]; } set { int index = RangeCheck( parameterName ); this.List[index] = value; } } public DesignParameter this[int index] { get { return (DesignParameter) this.List[index]; } } public bool Contains( string value ) { return (IndexOf(value) != -1); } public int IndexOf(string parameterName) { int count = this.InnerList.Count; // karolz 2/25/2002: Some backends allow for server settings that treat the parameter names in case-insensitive // way. However it is probably good enough to assume here that all the names are case-sensitive. for (int i = 0; i < count; ++i) { if( StringUtil.EqualValue( parameterName, ((IDbDataParameter) this.InnerList[i]).ParameterName)) { return i; } } return -1; } private int RangeCheck(string parameterName) { int index = IndexOf( parameterName ); if( index < 0 ) { throw new InternalException(string.Format(System.Globalization.CultureInfo.CurrentCulture, VSDExceptions.DataSource.PARAMETER_NOT_FOUND_MSG, parameterName), VSDExceptions.DataSource.PARAMETER_NOT_FOUND_CODE ); } return index; } public void RemoveAt( string parameterName ) { int index = RangeCheck( parameterName ); this.List.RemoveAt( index ); } protected override Type ItemType { get { return typeof(DesignParameter); } } public object Clone() { DbSourceParameterCollection clone = new DbSourceParameterCollection(null); foreach( DesignParameter param in this ) { DesignParameter newParam = (DesignParameter) param.Clone(); ((IList) clone).Add( newParam ); } return clone; } } } // 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
- KeyedCollection.cs
- WebPartExportVerb.cs
- OutputCacheEntry.cs
- DataObjectSettingDataEventArgs.cs
- TypeSource.cs
- PresentationAppDomainManager.cs
- HttpServerUtilityBase.cs
- DbReferenceCollection.cs
- ExpandCollapsePattern.cs
- ToolStripItemCollection.cs
- CustomServiceCredentials.cs
- DataKeyCollection.cs
- ManipulationCompletedEventArgs.cs
- DataControlFieldCell.cs
- ListBox.cs
- ExpandableObjectConverter.cs
- WorkflowApplicationEventArgs.cs
- TriggerCollection.cs
- Tokenizer.cs
- TheQuery.cs
- BadImageFormatException.cs
- SiteOfOriginPart.cs
- SqlConnectionManager.cs
- KeyValueConfigurationElement.cs
- XPathDocumentIterator.cs
- QuotaExceededException.cs
- WebPartDeleteVerb.cs
- DataGridColumn.cs
- TextSchema.cs
- PageBuildProvider.cs
- RouteParameter.cs
- ThreadInterruptedException.cs
- Application.cs
- SmtpFailedRecipientException.cs
- SerializationAttributes.cs
- APCustomTypeDescriptor.cs
- GPStream.cs
- Section.cs
- MediaElementAutomationPeer.cs
- CodeNamespace.cs
- TableLayoutRowStyleCollection.cs
- WebPartPersonalization.cs
- SqlFactory.cs
- ContextInformation.cs
- SqlCacheDependencyDatabase.cs
- CellParaClient.cs
- RuleDefinitions.cs
- MenuItemCollection.cs
- Object.cs
- CompileXomlTask.cs
- HttpServerVarsCollection.cs
- LowerCaseStringConverter.cs
- RadialGradientBrush.cs
- ScrollProviderWrapper.cs
- Monitor.cs
- TimeSpanStorage.cs
- ImageAnimator.cs
- CommandField.cs
- TextPointer.cs
- StackSpiller.Bindings.cs
- WebSysDefaultValueAttribute.cs
- StringConcat.cs
- UpdateRecord.cs
- XmlSchemaDocumentation.cs
- GacUtil.cs
- OleDbTransaction.cs
- DefaultValidator.cs
- Divide.cs
- Module.cs
- CommonGetThemePartSize.cs
- MarshalByValueComponent.cs
- TextSelectionProcessor.cs
- SQLBoolean.cs
- BitmapCache.cs
- TypeDescriptor.cs
- DataGridTable.cs
- MultipleViewPattern.cs
- HostProtectionPermission.cs
- EventData.cs
- CachedPathData.cs
- BindingCompleteEventArgs.cs
- Resources.Designer.cs
- XmlValidatingReaderImpl.cs
- WsdlBuildProvider.cs
- LateBoundBitmapDecoder.cs
- SqlCharStream.cs
- StringStorage.cs
- VisualBasic.cs
- ServiceModelSectionGroup.cs
- EasingQuaternionKeyFrame.cs
- WebServiceErrorEvent.cs
- DataSourceCacheDurationConverter.cs
- ThemeableAttribute.cs
- HostedTcpTransportManager.cs
- path.cs
- HttpPostProtocolImporter.cs
- OdbcConnectionHandle.cs
- Int32EqualityComparer.cs
- Function.cs
- RectAnimationUsingKeyFrames.cs