Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / GrammarBuilding / IdentifierCollection.cs / 1 / IdentifierCollection.cs
//------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System.Collections.Generic; namespace System.Speech.Internal.GrammarBuilding { ////// /// internal class IdentifierCollection { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// internal IdentifierCollection() { _identifiers = new List(); CreateNewIdentifier ("_"); } #endregion //******************************************************************** // // Internal Methods // //******************************************************************* #region Internal Methods /// /// /// /// ///internal string CreateNewIdentifier(string id) { if (!_identifiers.Contains(id)) { _identifiers.Add(id); return id; } else { string newId; int i = 1; do { newId = id + i; i++; } while (_identifiers.Contains(newId)); _identifiers.Add(newId); return newId; } } #endregion //******************************************************************** // // Protected Fields // //******************************************************************** #region Protected Fields /// /// /// protected List_identifiers; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System.Collections.Generic; namespace System.Speech.Internal.GrammarBuilding { ////// /// internal class IdentifierCollection { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// internal IdentifierCollection() { _identifiers = new List(); CreateNewIdentifier ("_"); } #endregion //******************************************************************** // // Internal Methods // //******************************************************************* #region Internal Methods /// /// /// /// ///internal string CreateNewIdentifier(string id) { if (!_identifiers.Contains(id)) { _identifiers.Add(id); return id; } else { string newId; int i = 1; do { newId = id + i; i++; } while (_identifiers.Contains(newId)); _identifiers.Add(newId); return newId; } } #endregion //******************************************************************** // // Protected Fields // //******************************************************************** #region Protected Fields /// /// /// protected List_identifiers; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HighlightVisual.cs
- ValidationHelpers.cs
- XmlMembersMapping.cs
- Rijndael.cs
- PageThemeCodeDomTreeGenerator.cs
- Column.cs
- DeleteMemberBinder.cs
- SqlTypeSystemProvider.cs
- COM2FontConverter.cs
- XmlByteStreamReader.cs
- ByteAnimation.cs
- RuleProcessor.cs
- SqlInternalConnectionSmi.cs
- SingleAnimation.cs
- HtmlDocument.cs
- xml.cs
- SRGSCompiler.cs
- QilNode.cs
- QueryReaderSettings.cs
- WindowsRichEditRange.cs
- TransformProviderWrapper.cs
- FunctionImportElement.cs
- XmlResolver.cs
- SmtpReplyReaderFactory.cs
- TypeDescriptionProviderAttribute.cs
- SchemaContext.cs
- XmlChoiceIdentifierAttribute.cs
- DisableDpiAwarenessAttribute.cs
- Int32Storage.cs
- TrailingSpaceComparer.cs
- PolicyStatement.cs
- BindingElementCollection.cs
- FieldAccessException.cs
- MembershipValidatePasswordEventArgs.cs
- DataObjectAttribute.cs
- DataSourceControl.cs
- XmlTextAttribute.cs
- AsymmetricAlgorithm.cs
- ImageSource.cs
- GatewayDefinition.cs
- ModelMemberCollection.cs
- XmlSchemaGroup.cs
- StyleXamlParser.cs
- ComplusEndpointConfigContainer.cs
- ScrollEvent.cs
- XmlUrlResolver.cs
- XmlnsCache.cs
- UnsafeNativeMethodsPenimc.cs
- PropVariant.cs
- OutKeywords.cs
- SqlWriter.cs
- DbgCompiler.cs
- TableLayoutPanelDesigner.cs
- IRCollection.cs
- DataPagerCommandEventArgs.cs
- PrintEvent.cs
- FragmentQueryProcessor.cs
- AbstractDataSvcMapFileLoader.cs
- Viewport2DVisual3D.cs
- QueryAsyncResult.cs
- DataGridRelationshipRow.cs
- PropertyPath.cs
- RelationshipType.cs
- TextServicesPropertyRanges.cs
- sqlstateclientmanager.cs
- UpdatePanel.cs
- ExpressionConverter.cs
- CngKeyCreationParameters.cs
- ImmutableObjectAttribute.cs
- EffectiveValueEntry.cs
- Pen.cs
- InternalConfigEventArgs.cs
- XmlUnspecifiedAttribute.cs
- Parameter.cs
- ValueProviderWrapper.cs
- RadioButtonAutomationPeer.cs
- HtmlElementErrorEventArgs.cs
- BitmapMetadata.cs
- CheckBoxField.cs
- Rule.cs
- ToolStripItemCollection.cs
- FileChangesMonitor.cs
- HttpRuntime.cs
- OLEDB_Enum.cs
- CheckBoxList.cs
- XmlFileEditor.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- MethodBody.cs
- DataGridViewSortCompareEventArgs.cs
- SecurityTokenRequirement.cs
- BitmapCache.cs
- MenuItemStyleCollection.cs
- ListSortDescriptionCollection.cs
- PagedDataSource.cs
- NativeMethodsCLR.cs
- TextDecorationCollectionConverter.cs
- PlanCompiler.cs
- Workspace.cs
- SqlUdtInfo.cs
- UIElementIsland.cs