Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntityDesign / Design / System / Data / Entity / Design / PluralizationService / PluralizationServiceUtil.cs / 1305376 / PluralizationServiceUtil.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Linq; using System.Globalization; namespace System.Data.Entity.Design.PluralizationServices { internal static class PluralizationServiceUtil { internal static bool DoesWordContainSuffix(string word, IEnumerablesuffixes, CultureInfo culture) { if (suffixes.Any(s => word.EndsWith(s, true, culture))) { return true; } else { return false; } } internal static bool TryGetMatchedSuffixForWord(string word, IEnumerable suffixes, CultureInfo culture, out string matchedSuffix) { matchedSuffix = null; if (DoesWordContainSuffix(word, suffixes, culture)) { matchedSuffix = suffixes.First(s => word.EndsWith(s, true, culture)); return true; } else { return false; } } internal static bool TryInflectOnSuffixInWord(string word, IEnumerable suffixes, Func operationOnWord, CultureInfo culture, out string newWord) { newWord = null; string matchedSuffixString; if (PluralizationServiceUtil.TryGetMatchedSuffixForWord( word, suffixes, culture, out matchedSuffixString)) { newWord = operationOnWord(word); return true; } else { return false; } } } } // 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
- SerializationInfo.cs
- EdmComplexPropertyAttribute.cs
- ParseChildrenAsPropertiesAttribute.cs
- BreakSafeBase.cs
- CompressEmulationStream.cs
- ErrorProvider.cs
- Int16Storage.cs
- Nullable.cs
- TimeoutException.cs
- HttpFileCollection.cs
- _Connection.cs
- CompilerScope.Storage.cs
- CommandHelper.cs
- PartitionResolver.cs
- PerSessionInstanceContextProvider.cs
- KeySplineConverter.cs
- Bitmap.cs
- InvalidComObjectException.cs
- VisualStyleTypesAndProperties.cs
- HttpPostedFileBase.cs
- CryptoApi.cs
- XmlArrayAttribute.cs
- NCryptSafeHandles.cs
- WindowsToolbarAsMenu.cs
- HttpListenerRequest.cs
- GAC.cs
- HtmlString.cs
- ConnectionPointCookie.cs
- XmlSchemaChoice.cs
- DomainConstraint.cs
- TemplatePartAttribute.cs
- Hash.cs
- MappingModelBuildProvider.cs
- SystemIcons.cs
- SmiEventSink_Default.cs
- SingleTagSectionHandler.cs
- SlipBehavior.cs
- FilterEventArgs.cs
- XmlReturnReader.cs
- RubberbandSelector.cs
- EventManager.cs
- XmlSchemaInclude.cs
- IpcClientChannel.cs
- XPathNavigatorKeyComparer.cs
- WebConfigurationHostFileChange.cs
- MatrixStack.cs
- SoundPlayer.cs
- WorkflowIdleElement.cs
- DBDataPermissionAttribute.cs
- ParameterCollectionEditor.cs
- SurrogateSelector.cs
- ButtonBaseAutomationPeer.cs
- NavigationPropertyEmitter.cs
- PasswordRecovery.cs
- AutomationPropertyInfo.cs
- SHA1CryptoServiceProvider.cs
- FormViewCommandEventArgs.cs
- TabletDevice.cs
- ParenExpr.cs
- ConfigDefinitionUpdates.cs
- CounterSampleCalculator.cs
- SharedConnectionInfo.cs
- SqlDataSourceEnumerator.cs
- DetailsViewPagerRow.cs
- MultiPropertyDescriptorGridEntry.cs
- StringComparer.cs
- VerticalAlignConverter.cs
- Point.cs
- Composition.cs
- IsolatedStorageException.cs
- TextDecoration.cs
- RijndaelManaged.cs
- RadioButtonPopupAdapter.cs
- ExternalException.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- PersonalizationStateQuery.cs
- MeshGeometry3D.cs
- AttributeCollection.cs
- PasswordBoxAutomationPeer.cs
- LineProperties.cs
- AuthenticationServiceManager.cs
- WebService.cs
- XmlKeywords.cs
- SpellerInterop.cs
- ParameterCollection.cs
- XmlExceptionHelper.cs
- BitmapDecoder.cs
- RoutedEventHandlerInfo.cs
- RegisteredDisposeScript.cs
- EditorZone.cs
- WindowProviderWrapper.cs
- QueryParameter.cs
- DataServiceConfiguration.cs
- TextSelectionHelper.cs
- entityreference_tresulttype.cs
- ButtonPopupAdapter.cs
- ServiceModelEnumValidatorAttribute.cs
- ISCIIEncoding.cs
- PageContentAsyncResult.cs
- SerialErrors.cs