Code:
/ FX-1434 / FX-1434 / 1.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
- PackageDigitalSignature.cs
- __TransparentProxy.cs
- CacheAxisQuery.cs
- PersonalizableTypeEntry.cs
- MailHeaderInfo.cs
- ToolStripDropDownMenu.cs
- Message.cs
- GeometryConverter.cs
- DataGridViewCellFormattingEventArgs.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- TextRangeBase.cs
- RegistrySecurity.cs
- PropertyConverter.cs
- EncoderBestFitFallback.cs
- RelationshipEndCollection.cs
- DesignTimeVisibleAttribute.cs
- BufferedReadStream.cs
- XmlSchemaSimpleType.cs
- XmlWriter.cs
- ListManagerBindingsCollection.cs
- GetPageNumberCompletedEventArgs.cs
- WinEventQueueItem.cs
- AppDomainShutdownMonitor.cs
- DataRowExtensions.cs
- DataColumnPropertyDescriptor.cs
- LinkConverter.cs
- BrowserCapabilitiesCompiler.cs
- StringWriter.cs
- WebPartActionVerb.cs
- SafeNativeMethods.cs
- UnionCodeGroup.cs
- SafeCryptoHandles.cs
- TaskExceptionHolder.cs
- HashMembershipCondition.cs
- BufferedReadStream.cs
- CodeRemoveEventStatement.cs
- MultiSelectRootGridEntry.cs
- StrongNameKeyPair.cs
- ThemeableAttribute.cs
- DataSourceView.cs
- TextModifier.cs
- TextMetrics.cs
- ClearTypeHintValidation.cs
- XmlDeclaration.cs
- DispatcherExceptionFilterEventArgs.cs
- LinkLabelLinkClickedEvent.cs
- NamedPipeChannelFactory.cs
- MultiTrigger.cs
- ToolStripPanelRow.cs
- ExternalCalls.cs
- XmlReturnReader.cs
- ListControl.cs
- DependencyPropertyConverter.cs
- XmlQualifiedName.cs
- MergeFilterQuery.cs
- SymmetricAlgorithm.cs
- Decimal.cs
- WebSysDisplayNameAttribute.cs
- TemplatingOptionsDialog.cs
- CommonDialog.cs
- TypeConverterHelper.cs
- TextEvent.cs
- Label.cs
- IgnoreSectionHandler.cs
- LineSegment.cs
- CollectionViewProxy.cs
- ReadOnlyHierarchicalDataSource.cs
- KoreanCalendar.cs
- SafePEFileHandle.cs
- XmlChildEnumerator.cs
- SystemWebCachingSectionGroup.cs
- CodeDirectiveCollection.cs
- Emitter.cs
- BufferModesCollection.cs
- DataPagerFieldItem.cs
- EntityRecordInfo.cs
- UriTemplateHelpers.cs
- ConnectionStringsExpressionBuilder.cs
- DirectoryNotFoundException.cs
- FunctionGenerator.cs
- IPAddressCollection.cs
- CacheAxisQuery.cs
- JoinElimination.cs
- Rotation3DAnimationBase.cs
- BindingManagerDataErrorEventArgs.cs
- DelegateSerializationHolder.cs
- ObjectDataSourceSelectingEventArgs.cs
- EventEntry.cs
- BlurBitmapEffect.cs
- NativeWindow.cs
- Command.cs
- PeerCollaboration.cs
- DataServiceConfiguration.cs
- ObjectDataSourceWizardForm.cs
- UserControlBuildProvider.cs
- SoapRpcMethodAttribute.cs
- FillRuleValidation.cs
- ByteRangeDownloader.cs
- CodeMethodInvokeExpression.cs
- DateBoldEvent.cs