Code:
/ FX-1434 / FX-1434 / 1.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
- SqlGenerator.cs
- AspProxy.cs
- BulletChrome.cs
- EventlogProvider.cs
- DataContractSerializerElement.cs
- ByeOperationCD1AsyncResult.cs
- XamlParser.cs
- ReceiveSecurityHeaderElementManager.cs
- CodeAttributeArgument.cs
- RegistryKey.cs
- DataGridViewAccessibleObject.cs
- RunInstallerAttribute.cs
- CollectionChangedEventManager.cs
- DataServiceQueryOfT.cs
- EmbeddedObject.cs
- Bits.cs
- Region.cs
- ServiceManagerHandle.cs
- UserControl.cs
- RuleInfoComparer.cs
- Validator.cs
- SeekStoryboard.cs
- ColorPalette.cs
- ResetableIterator.cs
- XmlDataCollection.cs
- ConsoleTraceListener.cs
- CompilerError.cs
- XPathEmptyIterator.cs
- WebPartVerbCollection.cs
- WebPartConnectionsCloseVerb.cs
- TraceLevelStore.cs
- TreeNodeCollection.cs
- HtmlElementCollection.cs
- PrintDialog.cs
- ConfigurationException.cs
- RuntimeHandles.cs
- EndCreateSecurityTokenRequest.cs
- TextEditorCopyPaste.cs
- SchemaDeclBase.cs
- cookiecontainer.cs
- DataGridRowHeaderAutomationPeer.cs
- SqlProfileProvider.cs
- DrawingGroupDrawingContext.cs
- XmlAttribute.cs
- ConnectionPointCookie.cs
- RequestBringIntoViewEventArgs.cs
- util.cs
- OleDbError.cs
- TabControlEvent.cs
- EdmPropertyAttribute.cs
- MLangCodePageEncoding.cs
- ProfileManager.cs
- DesignBindingPropertyDescriptor.cs
- Compress.cs
- CancellationState.cs
- ProfileModule.cs
- ClosureBinding.cs
- AssemblyHelper.cs
- TextBreakpoint.cs
- TransformerInfoCollection.cs
- HttpProcessUtility.cs
- ConnectionManagementSection.cs
- EdmProperty.cs
- LeaseManager.cs
- WebPartTransformerCollection.cs
- InkCanvasSelection.cs
- PrintPreviewGraphics.cs
- ValueChangedEventManager.cs
- Border.cs
- CounterSampleCalculator.cs
- ToolStripDesignerAvailabilityAttribute.cs
- MapPathBasedVirtualPathProvider.cs
- PiiTraceSource.cs
- TreeView.cs
- CodeDomSerializer.cs
- DataObjectEventArgs.cs
- MessageHeaderDescriptionCollection.cs
- OracleMonthSpan.cs
- XmlILConstructAnalyzer.cs
- SessionPageStateSection.cs
- FileClassifier.cs
- DesignTimeParseData.cs
- XmlSignatureProperties.cs
- BitmapEffectvisualstate.cs
- HttpListenerResponse.cs
- objectquery_tresulttype.cs
- FeatureAttribute.cs
- ScriptingWebServicesSectionGroup.cs
- AmbientProperties.cs
- SqlFormatter.cs
- Function.cs
- AmbientLight.cs
- SqlDeflator.cs
- SpellerInterop.cs
- RoleService.cs
- Int32Converter.cs
- FileEnumerator.cs
- TableDesigner.cs
- ZipIOLocalFileHeader.cs
- WebPartAddingEventArgs.cs