Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / GenericNameHandler.cs / 2 / GenericNameHandler.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // //----------------------------------------------------------------------------- namespace System.Data.Design { using System; using System.Collections; using System.Globalization; using System.CodeDom.Compiler; internal sealed class GenericNameHandler { private MemberNameValidator validator = null; private Hashtable names = null; internal GenericNameHandler(ICollection initialNameSet, CodeDomProvider codeProvider) { validator = new MemberNameValidator(initialNameSet, codeProvider, true /*languageCaseInsensitive*/); names = new Hashtable(StringComparer.Ordinal); } internal string AddParameterNameToList(string originalName, string parameterPrefix) { if (originalName == null) { throw new ArgumentNullException("originalName"); } string noPrefixOriginalName = originalName; if (!StringUtil.Empty(parameterPrefix)) { if (originalName.StartsWith(parameterPrefix, StringComparison.Ordinal)) { noPrefixOriginalName = originalName.Substring(parameterPrefix.Length); } } string validatedName = validator.GetNewMemberName(noPrefixOriginalName); names.Add(originalName, validatedName); return validatedName; } internal string AddNameToList(string originalName) { if(originalName == null) { throw new InternalException("Parameter originalName should not be null."); } string validatedName = validator.GetNewMemberName(originalName); names.Add(originalName, validatedName); return validatedName; } internal string GetNameFromList(string originalName) { if(originalName == null) { throw new InternalException("Parameter originalName should not be null."); } return (string) names[originalName]; } } } // 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
- CodeSubDirectory.cs
- XmlValueConverter.cs
- WebHttpBindingCollectionElement.cs
- BinaryKeyIdentifierClause.cs
- DbConnectionStringBuilder.cs
- DisplayNameAttribute.cs
- WebRequestModuleElementCollection.cs
- HitTestParameters3D.cs
- SystemIPInterfaceProperties.cs
- JpegBitmapDecoder.cs
- FormViewRow.cs
- DisplayToken.cs
- LinqDataSourceHelper.cs
- KeyConstraint.cs
- FixedSOMTableCell.cs
- SmiTypedGetterSetter.cs
- ListViewDataItem.cs
- RectAnimation.cs
- ProcessInputEventArgs.cs
- OverflowException.cs
- FixedDocument.cs
- StyleModeStack.cs
- AttachmentService.cs
- DbParameterCollection.cs
- MemberExpressionHelper.cs
- FreezableCollection.cs
- Win32KeyboardDevice.cs
- EventLogLink.cs
- ExtentKey.cs
- InvalidPropValue.cs
- XmlNamespaceMappingCollection.cs
- DirectoryGroupQuery.cs
- DrawListViewItemEventArgs.cs
- relpropertyhelper.cs
- CodePageEncoding.cs
- TextServicesCompartmentEventSink.cs
- StorageComplexTypeMapping.cs
- ByteAnimation.cs
- SerialReceived.cs
- ToolStripPanelRow.cs
- CellPartitioner.cs
- ResourceProperty.cs
- UrlMapping.cs
- SimpleColumnProvider.cs
- ConditionBrowserDialog.cs
- StringStorage.cs
- DataGridViewCellValueEventArgs.cs
- LoaderAllocator.cs
- UserControl.cs
- AssociationEndMember.cs
- _AuthenticationState.cs
- Int32RectConverter.cs
- DesignerForm.cs
- Literal.cs
- XmlProcessingInstruction.cs
- ViewCellRelation.cs
- AutoResetEvent.cs
- MetaData.cs
- TypeUtil.cs
- DBConnectionString.cs
- ObjRef.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- CommandArguments.cs
- Internal.cs
- DetailsViewInsertEventArgs.cs
- SafeHandle.cs
- ProjectionPathSegment.cs
- Int64.cs
- AssemblyInfo.cs
- IndividualDeviceConfig.cs
- PropertyChangingEventArgs.cs
- SoapProcessingBehavior.cs
- DesignerAdapterUtil.cs
- PreservationFileWriter.cs
- InternalCache.cs
- XmlSchemaInfo.cs
- DateTimeOffsetAdapter.cs
- WebServiceData.cs
- SkewTransform.cs
- SessionSwitchEventArgs.cs
- XMLUtil.cs
- Point3DAnimationBase.cs
- WebPartConnection.cs
- FileDialog_Vista.cs
- AnonymousIdentificationModule.cs
- RouteUrlExpressionBuilder.cs
- SiteMapSection.cs
- XmlBoundElement.cs
- ThicknessConverter.cs
- SplitterDesigner.cs
- ConnectionPointGlyph.cs
- ResourceDisplayNameAttribute.cs
- TextEffectResolver.cs
- EndpointAddressMessageFilter.cs
- PrivateFontCollection.cs
- MouseEventArgs.cs
- XmlEncodedRawTextWriter.cs
- ListMarkerSourceInfo.cs
- DetailsView.cs
- StylusPointProperties.cs