Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / StringUtil.cs / 3 / StringUtil.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // //----------------------------------------------------------------------------- namespace System.Data.Design { using System; using System.Diagnostics; using System.Globalization; ////// This class stores some common used string utility functions /// used by any class in this dll. /// internal sealed class StringUtil { ////// Private contstructor to avoid class being instantiated. /// private StringUtil() { } ////// Checks to see if the string is empty or null /// ////// true if the string is empty and not null /// internal static bool Empty(string str) { return ((null == str) || (0 >= str.Length)); } ////// Checks to see if the string is empty or null or only contains spaces /// ////// true if the string is not empty and not null /// internal static bool EmptyOrSpace(string str) { return ((null == str) || (0 >= (str.Trim()).Length)); } ////// Compare two strings with invariant culture and case sensitive /// Also consider the null cases /// internal static bool EqualValue(string str1, string str2){ return EqualValue(str1, str2, false); } ////// Compare two strings with invariant culture and specified case sensitivity /// Also consider the null cases /// internal static bool EqualValue(string str1, string str2, bool caseInsensitive){ if((str1 != null) && (str2 != null)) { StringComparison compararison = caseInsensitive ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; return String.Equals(str1, str2, compararison); } return str1 == str2; } ////// We need this function as the VSDesigner.Data.DesignUtil has this one /// We want the change ove to be seamless. /// internal static bool NotEmpty(string str) { return !Empty(str); } ////// Check the string is empty or null /// ////// true if the string is not empty and not null /// public static bool NotEmptyAfterTrim(string str) { return !EmptyOrSpace(str); } } } // 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
- DBNull.cs
- ConstraintStruct.cs
- ControllableStoryboardAction.cs
- CatalogPartCollection.cs
- C14NUtil.cs
- DynamicRenderer.cs
- DataErrorValidationRule.cs
- RenameRuleObjectDialog.Designer.cs
- LocationChangedEventArgs.cs
- XsdSchemaFileEditor.cs
- HttpListenerTimeoutManager.cs
- CodeNamespaceImport.cs
- AsyncPostBackTrigger.cs
- TextDecorationLocationValidation.cs
- StylusDevice.cs
- CodeArrayIndexerExpression.cs
- HMACSHA256.cs
- DefaultAutoFieldGenerator.cs
- DATA_BLOB.cs
- IntellisenseTextBox.cs
- Rect3D.cs
- ActivityTypeCodeDomSerializer.cs
- NetDispatcherFaultException.cs
- DataGridViewCellCollection.cs
- UserMapPath.cs
- DataDocumentXPathNavigator.cs
- TextEditorContextMenu.cs
- Size.cs
- AsyncPostBackErrorEventArgs.cs
- StackBuilderSink.cs
- ProfileEventArgs.cs
- WindowHideOrCloseTracker.cs
- MLangCodePageEncoding.cs
- XPathScanner.cs
- DragDeltaEventArgs.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ModelItemExtensions.cs
- RelationshipEndCollection.cs
- SafeFindHandle.cs
- ListItemCollection.cs
- BrowserInteropHelper.cs
- DataListItemEventArgs.cs
- ClientSettings.cs
- FixedPageAutomationPeer.cs
- MaskPropertyEditor.cs
- PrimitiveType.cs
- FormattedTextSymbols.cs
- Stopwatch.cs
- Convert.cs
- RuleDefinitions.cs
- UIAgentAsyncBeginRequest.cs
- GridViewEditEventArgs.cs
- QueryOptionExpression.cs
- UnsafeNativeMethods.cs
- SmtpNegotiateAuthenticationModule.cs
- TableCellCollection.cs
- RequestTimeoutManager.cs
- MsmqIntegrationProcessProtocolHandler.cs
- CommentEmitter.cs
- BaseCollection.cs
- XmlSchemaExternal.cs
- BindingCollection.cs
- FactoryMaker.cs
- safelinkcollection.cs
- UserInitiatedNavigationPermission.cs
- Point4DValueSerializer.cs
- UserNameSecurityToken.cs
- GlyphRun.cs
- TreeView.cs
- SafePointer.cs
- VisualTreeUtils.cs
- TransformCollection.cs
- OdbcRowUpdatingEvent.cs
- EDesignUtil.cs
- RootBrowserWindowAutomationPeer.cs
- LoadedOrUnloadedOperation.cs
- CompositionAdorner.cs
- HwndStylusInputProvider.cs
- ReverseInheritProperty.cs
- WorkflowView.cs
- EntityDataSourceContextCreatingEventArgs.cs
- StoreItemCollection.Loader.cs
- SqlServer2KCompatibilityAnnotation.cs
- ExtentKey.cs
- ProxyFragment.cs
- DynamicActionMessageFilter.cs
- ReachDocumentReferenceSerializerAsync.cs
- TextEditorSelection.cs
- BinaryUtilClasses.cs
- ParagraphVisual.cs
- CaseStatementSlot.cs
- PassportAuthenticationEventArgs.cs
- TemplateControl.cs
- SourceSwitch.cs
- StrongName.cs
- ReadOnlyObservableCollection.cs
- WindowVisualStateTracker.cs
- TypedTableBaseExtensions.cs
- UriTemplatePathSegment.cs
- GeneratedView.cs