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
- CompositeFontInfo.cs
- Util.cs
- MenuItemStyle.cs
- AssertFilter.cs
- TextFormatter.cs
- GroupLabel.cs
- ProgressBarHighlightConverter.cs
- EasingQuaternionKeyFrame.cs
- DataGridViewCell.cs
- SmtpCommands.cs
- DispatcherHooks.cs
- CachedFontFace.cs
- SqlBuffer.cs
- CustomTrackingQuery.cs
- GetMemberBinder.cs
- MatrixTransform.cs
- Clock.cs
- HttpConfigurationContext.cs
- EventLogPermissionEntryCollection.cs
- Reference.cs
- Missing.cs
- ToolStripGripRenderEventArgs.cs
- XmlSecureResolver.cs
- TemplateControlBuildProvider.cs
- DoubleLinkListEnumerator.cs
- ResourceManagerWrapper.cs
- DbSourceCommand.cs
- Cursor.cs
- DbConnectionClosed.cs
- ReturnType.cs
- ToolStripRenderEventArgs.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- HMACSHA512.cs
- ColumnWidthChangedEvent.cs
- XmlDataLoader.cs
- StorageAssociationSetMapping.cs
- NTAccount.cs
- ClickablePoint.cs
- Vector.cs
- PerformanceCounter.cs
- GridItemProviderWrapper.cs
- SharedDp.cs
- DocumentSchemaValidator.cs
- ToolStripMenuItem.cs
- COM2ExtendedBrowsingHandler.cs
- ImageButton.cs
- StringArrayConverter.cs
- CFStream.cs
- WbmpConverter.cs
- _emptywebproxy.cs
- Compiler.cs
- DoubleKeyFrameCollection.cs
- Item.cs
- HuffCodec.cs
- InfoCardBaseException.cs
- MenuItem.cs
- PrintPreviewDialog.cs
- SendingRequestEventArgs.cs
- EncodingTable.cs
- WmiEventSink.cs
- LightweightCodeGenerator.cs
- ViewCellSlot.cs
- PeerPresenceInfo.cs
- TripleDES.cs
- SubqueryTrackingVisitor.cs
- SQLInt32.cs
- MergablePropertyAttribute.cs
- TextTreeRootNode.cs
- DtcInterfaces.cs
- InputScope.cs
- SchemaManager.cs
- ComplexBindingPropertiesAttribute.cs
- CodeRegionDirective.cs
- TranslateTransform3D.cs
- HelpProvider.cs
- SymbolDocumentGenerator.cs
- CatalogPartChrome.cs
- XmlReaderSettings.cs
- ProxyManager.cs
- RequestCachePolicyConverter.cs
- StylusButtonEventArgs.cs
- EventLogRecord.cs
- DataErrorValidationRule.cs
- NameValueSectionHandler.cs
- IDQuery.cs
- TemplatedWizardStep.cs
- AsymmetricSignatureFormatter.cs
- Rect.cs
- Storyboard.cs
- WebPartZoneCollection.cs
- PathGeometry.cs
- ConfigXmlCDataSection.cs
- ErrorFormatter.cs
- TimeoutException.cs
- _BasicClient.cs
- SHA256Cng.cs
- InstanceKeyNotReadyException.cs
- ProjectionQueryOptionExpression.cs
- cryptoapiTransform.cs
- PaperSource.cs