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
- Rectangle.cs
- RootBrowserWindowProxy.cs
- CompressionTracing.cs
- HtmlInputRadioButton.cs
- SqlInternalConnection.cs
- securestring.cs
- HuffmanTree.cs
- GeometryConverter.cs
- DataTablePropertyDescriptor.cs
- EncodingInfo.cs
- HintTextConverter.cs
- SrgsSemanticInterpretationTag.cs
- BufferedReadStream.cs
- DictionaryMarkupSerializer.cs
- RtfToken.cs
- FamilyTypefaceCollection.cs
- SslStream.cs
- WebPartCatalogAddVerb.cs
- WebPartMenuStyle.cs
- ComponentEditorForm.cs
- WorkflowPageSetupDialog.cs
- FormsAuthenticationUserCollection.cs
- Expr.cs
- MulticastOption.cs
- ProcessHostFactoryHelper.cs
- Form.cs
- Variable.cs
- DesignerObject.cs
- NativeMethods.cs
- AppSettingsExpressionBuilder.cs
- ArrayHelper.cs
- ModelUIElement3D.cs
- EventMetadata.cs
- PlanCompiler.cs
- DataRowChangeEvent.cs
- ServiceNameElement.cs
- RealizationContext.cs
- TextTrailingWordEllipsis.cs
- FormsIdentity.cs
- Constants.cs
- ControlTemplate.cs
- LoginView.cs
- Brush.cs
- IChannel.cs
- InProcStateClientManager.cs
- AutomationPatternInfo.cs
- XmlToDatasetMap.cs
- FieldTemplateFactory.cs
- DispatcherHooks.cs
- QueryLifecycle.cs
- Char.cs
- SerializerProvider.cs
- ClearTypeHintValidation.cs
- PagerStyle.cs
- XmlTextAttribute.cs
- ChannelSinkStacks.cs
- XmlSchemaChoice.cs
- DoubleConverter.cs
- CfgParser.cs
- DeflateStreamAsyncResult.cs
- RadioButtonList.cs
- TreeWalker.cs
- HTTPRemotingHandler.cs
- RijndaelManagedTransform.cs
- CatalogPartChrome.cs
- SelectionHighlightInfo.cs
- ExceptionNotification.cs
- mediaeventargs.cs
- RegisteredHiddenField.cs
- DrawingImage.cs
- RuntimeWrappedException.cs
- Visual.cs
- DataGridViewElement.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DriveInfo.cs
- PropertyChangedEventManager.cs
- GradientBrush.cs
- HttpListenerTimeoutManager.cs
- TrackingServices.cs
- DataSvcMapFileSerializer.cs
- View.cs
- AccessibleObject.cs
- AsyncPostBackTrigger.cs
- ConfigsHelper.cs
- TitleStyle.cs
- Block.cs
- ByteRangeDownloader.cs
- HiddenFieldPageStatePersister.cs
- XPathMultyIterator.cs
- InternalRelationshipCollection.cs
- VirtualDirectoryMappingCollection.cs
- SoapAttributeOverrides.cs
- WindowsAuthenticationModule.cs
- Attributes.cs
- TextSelectionProcessor.cs
- LZCodec.cs
- FunctionDefinition.cs
- Stackframe.cs
- XamlTreeBuilderBamlRecordWriter.cs
- StringSource.cs