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
- SHA256.cs
- DashStyles.cs
- SqlWorkflowPersistenceService.cs
- LogWriteRestartAreaState.cs
- CompiledQueryCacheEntry.cs
- WebPermission.cs
- CellParagraph.cs
- OracleException.cs
- TranslateTransform.cs
- StreamAsIStream.cs
- StringExpressionSet.cs
- StateItem.cs
- ImageFormat.cs
- TabletDeviceInfo.cs
- SessionIDManager.cs
- GregorianCalendar.cs
- BindingContext.cs
- BaseResourcesBuildProvider.cs
- IPPacketInformation.cs
- CustomValidator.cs
- HostingEnvironmentException.cs
- CriticalFinalizerObject.cs
- EncoderReplacementFallback.cs
- AccessedThroughPropertyAttribute.cs
- XmlAutoDetectWriter.cs
- CalendarDesigner.cs
- ButtonChrome.cs
- AssociationTypeEmitter.cs
- ChannelManager.cs
- DaylightTime.cs
- COMException.cs
- URI.cs
- TablePattern.cs
- FileSystemInfo.cs
- SmtpNetworkElement.cs
- DataListItem.cs
- TreeViewEvent.cs
- CapiSafeHandles.cs
- DataTrigger.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- FrameworkPropertyMetadata.cs
- XmlSchemaImporter.cs
- CallContext.cs
- WebControlsSection.cs
- Int32CAMarshaler.cs
- RangeBase.cs
- Visitors.cs
- OpCellTreeNode.cs
- CopyOnWriteList.cs
- XmlUtil.cs
- DocumentPageHost.cs
- EntityDataSourceStatementEditorForm.cs
- ValueTable.cs
- TemplatedMailWebEventProvider.cs
- TreeWalkHelper.cs
- LassoHelper.cs
- SystemTcpConnection.cs
- Win32Native.cs
- ErrorStyle.cs
- Label.cs
- DataViewManager.cs
- DBCommandBuilder.cs
- AndCondition.cs
- GCHandleCookieTable.cs
- Soap.cs
- HttpCachePolicyWrapper.cs
- DecimalConverter.cs
- HttpRawResponse.cs
- iisPickupDirectory.cs
- RectangleHotSpot.cs
- MethodSet.cs
- securitycriticaldataformultiplegetandset.cs
- Win32PrintDialog.cs
- DeviceContext2.cs
- xsdvalidator.cs
- ExecutedRoutedEventArgs.cs
- QuadraticBezierSegment.cs
- HiddenFieldPageStatePersister.cs
- CodeAssignStatement.cs
- LayoutDump.cs
- KeyboardDevice.cs
- RequestedSignatureDialog.cs
- COM2Properties.cs
- WebPartHelpVerb.cs
- ImageDrawing.cs
- XmlCollation.cs
- ThreadPool.cs
- Attributes.cs
- SafeHandles.cs
- coordinatorfactory.cs
- StringConverter.cs
- WebPartZoneBaseDesigner.cs
- TextTreeUndo.cs
- NullRuntimeConfig.cs
- MaskedTextBoxDesigner.cs
- ClosableStream.cs
- ItemDragEvent.cs
- IpcChannel.cs
- TransportSecurityProtocolFactory.cs
- DataControlFieldCell.cs