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
- SqlDataSourceRefreshSchemaForm.cs
- AddInServer.cs
- PartBasedPackageProperties.cs
- ClaimTypes.cs
- RelationshipEntry.cs
- ResourceDictionaryCollection.cs
- EnumValAlphaComparer.cs
- CharacterHit.cs
- NullableDecimalSumAggregationOperator.cs
- StagingAreaInputItem.cs
- Matrix3DStack.cs
- Transform3DGroup.cs
- QualifiedId.cs
- IdnMapping.cs
- XmlCollation.cs
- ManipulationDevice.cs
- RecordConverter.cs
- AddInDeploymentState.cs
- SmtpAuthenticationManager.cs
- WindowsStreamSecurityBindingElement.cs
- Opcode.cs
- WebPartCatalogAddVerb.cs
- InheritanceRules.cs
- DefaultEventAttribute.cs
- securitymgrsite.cs
- ComponentSerializationService.cs
- PictureBox.cs
- TCEAdapterGenerator.cs
- AdjustableArrowCap.cs
- SettingsAttributeDictionary.cs
- InputScopeNameConverter.cs
- BookmarkScopeHandle.cs
- WindowsListView.cs
- Inflater.cs
- Int64KeyFrameCollection.cs
- ProcessModuleDesigner.cs
- AppearanceEditorPart.cs
- SoapReflectionImporter.cs
- SolidBrush.cs
- ProxyGenerator.cs
- LiteralControl.cs
- XmlToDatasetMap.cs
- NamespaceQuery.cs
- ExpressionUtilities.cs
- SessionSwitchEventArgs.cs
- mediaeventshelper.cs
- ConfigurationSettings.cs
- Blend.cs
- ListSourceHelper.cs
- FixedTextSelectionProcessor.cs
- RequestUriProcessor.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ScrollBarRenderer.cs
- OpCellTreeNode.cs
- TextDecorations.cs
- XPathScanner.cs
- DataGridPagerStyle.cs
- Label.cs
- CommandID.cs
- NullableFloatMinMaxAggregationOperator.cs
- MsdtcWrapper.cs
- SkewTransform.cs
- entitydatasourceentitysetnameconverter.cs
- FontDialog.cs
- FragmentQuery.cs
- Utilities.cs
- GeneralTransformGroup.cs
- TextEncodedRawTextWriter.cs
- BaseCollection.cs
- PointAnimationClockResource.cs
- DocumentSchemaValidator.cs
- GenericWebPart.cs
- SafeEventLogWriteHandle.cs
- Vertex.cs
- DigitShape.cs
- DataGridViewSelectedColumnCollection.cs
- PreviewKeyDownEventArgs.cs
- DocumentSequenceHighlightLayer.cs
- RoutedEventValueSerializer.cs
- KeyMatchBuilder.cs
- CommandBindingCollection.cs
- PrintingPermission.cs
- BitmapData.cs
- EDesignUtil.cs
- TemplateApplicationHelper.cs
- CodeActivity.cs
- invalidudtexception.cs
- ClientCredentialsSecurityTokenManager.cs
- ControlAdapter.cs
- WorkflowMessageEventArgs.cs
- PropVariant.cs
- XmlSchemaSimpleTypeRestriction.cs
- ParserContext.cs
- XmlDownloadManager.cs
- TreeIterator.cs
- PersonalizationProviderHelper.cs
- ServerValidateEventArgs.cs
- DataTableNewRowEvent.cs
- _NetworkingPerfCounters.cs