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
- IriParsingElement.cs
- GridItem.cs
- SystemWebCachingSectionGroup.cs
- XmlCharacterData.cs
- XmlWriter.cs
- OwnerDrawPropertyBag.cs
- PKCS1MaskGenerationMethod.cs
- CompilerError.cs
- TypeContext.cs
- EncoderFallback.cs
- UrlMappingsSection.cs
- HttpRawResponse.cs
- KeyValuePair.cs
- OrthographicCamera.cs
- SqlProvider.cs
- RuntimeConfig.cs
- DynamicUpdateCommand.cs
- ButtonBaseAutomationPeer.cs
- StreamGeometry.cs
- SQLDecimalStorage.cs
- SpeechSeg.cs
- ObjectDataSourceMethodEventArgs.cs
- TypeHelper.cs
- CSharpCodeProvider.cs
- StoreItemCollection.cs
- MetricEntry.cs
- ListBindingConverter.cs
- OrderingExpression.cs
- OutOfProcStateClientManager.cs
- MailSettingsSection.cs
- SimpleType.cs
- diagnosticsswitches.cs
- ExceptionRoutedEventArgs.cs
- SignedXml.cs
- SqlRecordBuffer.cs
- Stackframe.cs
- BitmapMetadata.cs
- ExpressionBuilderContext.cs
- Keywords.cs
- TableLayoutPanel.cs
- TableLayoutColumnStyleCollection.cs
- FixedSOMTextRun.cs
- PersistenceContextEnlistment.cs
- DataSourceSelectArguments.cs
- updateconfighost.cs
- XmlILCommand.cs
- Brushes.cs
- AvTraceFormat.cs
- XhtmlTextWriter.cs
- SafeFileMappingHandle.cs
- BodyGlyph.cs
- DataGridTableStyleMappingNameEditor.cs
- DataExpression.cs
- CompositeTypefaceMetrics.cs
- XmlParserContext.cs
- ContextMenuStrip.cs
- SqlNodeTypeOperators.cs
- TraceInternal.cs
- PropertyGridCommands.cs
- shaperfactory.cs
- Message.cs
- RectangleGeometry.cs
- DesignerActionItem.cs
- TempFiles.cs
- ExpressionBuilder.cs
- XmlSchemaSimpleTypeUnion.cs
- BuildProvidersCompiler.cs
- MembershipValidatePasswordEventArgs.cs
- Normalization.cs
- PropertyTabChangedEvent.cs
- SqlCommandSet.cs
- SearchForVirtualItemEventArgs.cs
- XmlDataSourceNodeDescriptor.cs
- WindowsListViewGroupSubsetLink.cs
- SchemaElementLookUpTable.cs
- Scheduling.cs
- DirectoryObjectSecurity.cs
- WebControl.cs
- DocumentViewerBaseAutomationPeer.cs
- FileSystemInfo.cs
- UnsafeNativeMethodsTablet.cs
- TrackingExtract.cs
- EntityDataSourceValidationException.cs
- ContextMarshalException.cs
- CryptoHandle.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ConnectionManagementElementCollection.cs
- PointValueSerializer.cs
- ColumnHeaderConverter.cs
- CompiledRegexRunner.cs
- DoubleIndependentAnimationStorage.cs
- Localizer.cs
- InputLanguageSource.cs
- MarkupCompilePass2.cs
- OleCmdHelper.cs
- SQLDoubleStorage.cs
- EventLogPermissionHolder.cs
- SimpleFieldTemplateFactory.cs
- CustomAttributeFormatException.cs
- HMACRIPEMD160.cs