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
- VirtualDirectoryMapping.cs
- ScrollViewer.cs
- SqlCacheDependencyDatabaseCollection.cs
- Int32Rect.cs
- XmlTextWriter.cs
- ContentIterators.cs
- AjaxFrameworkAssemblyAttribute.cs
- Compiler.cs
- Util.cs
- IProvider.cs
- DrawingBrush.cs
- ControlValuePropertyAttribute.cs
- ModuleElement.cs
- SingleObjectCollection.cs
- JournalEntryStack.cs
- CompareValidator.cs
- Update.cs
- FixedSOMPage.cs
- AppDomainAttributes.cs
- DynamicMethod.cs
- RtfFormatStack.cs
- Message.cs
- DataServiceHost.cs
- XmlCustomFormatter.cs
- Thickness.cs
- SizeIndependentAnimationStorage.cs
- ExitEventArgs.cs
- XmlObjectSerializerContext.cs
- StylusTouchDevice.cs
- AppSettingsReader.cs
- DataObjectSettingDataEventArgs.cs
- ColumnWidthChangingEvent.cs
- ColorMatrix.cs
- DocumentGridContextMenu.cs
- QueryContinueDragEventArgs.cs
- EnumConverter.cs
- SelectionBorderGlyph.cs
- Operand.cs
- AddInControllerImpl.cs
- BaseValidator.cs
- TokenBasedSetEnumerator.cs
- ConfigurationFileMap.cs
- GridViewColumnCollectionChangedEventArgs.cs
- RecommendedAsConfigurableAttribute.cs
- ComponentManagerBroker.cs
- Trigger.cs
- CodeMethodMap.cs
- RSAOAEPKeyExchangeDeformatter.cs
- VisualBasicDesignerHelper.cs
- PhonemeConverter.cs
- WindowPattern.cs
- LongAverageAggregationOperator.cs
- WebSysDescriptionAttribute.cs
- Executor.cs
- ToolStripSystemRenderer.cs
- ThemeConfigurationDialog.cs
- XmlNamespaceManager.cs
- MultiSelector.cs
- templategroup.cs
- ProcessHostFactoryHelper.cs
- WindowsPrincipal.cs
- SpanIndex.cs
- MetadataArtifactLoaderCompositeResource.cs
- ConstructorExpr.cs
- _ContextAwareResult.cs
- ValidationManager.cs
- SudsWriter.cs
- SecureUICommand.cs
- PersonalizationProvider.cs
- GeometryDrawing.cs
- QueryExecutionOption.cs
- SessionStateSection.cs
- FastEncoderWindow.cs
- EncoderReplacementFallback.cs
- MemoryFailPoint.cs
- GlyphRunDrawing.cs
- RoleExceptions.cs
- DispatchWrapper.cs
- NullReferenceException.cs
- LayoutUtils.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- XmlSchemaAttributeGroup.cs
- ServicesSection.cs
- Padding.cs
- Bitmap.cs
- DBSchemaTable.cs
- ListViewInsertEventArgs.cs
- TextEndOfLine.cs
- DictionaryBase.cs
- TileModeValidation.cs
- TextFormattingConverter.cs
- TypeDelegator.cs
- AnimationStorage.cs
- Common.cs
- RangeValueProviderWrapper.cs
- DataConnectionHelper.cs
- BooleanFunctions.cs
- HttpModuleCollection.cs
- DeviceContext.cs
- MultiPageTextView.cs