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
- GiveFeedbackEventArgs.cs
- DataColumnCollection.cs
- SoapEnumAttribute.cs
- DesignUtil.cs
- SHA384.cs
- AnnotationResourceCollection.cs
- WpfKnownMemberInvoker.cs
- TableColumn.cs
- NativeMethodsOther.cs
- FormViewDeleteEventArgs.cs
- ExceptionHandlerDesigner.cs
- IncrementalCompileAnalyzer.cs
- MenuItemBinding.cs
- WebConfigurationHost.cs
- FieldTemplateFactory.cs
- CheckBox.cs
- AuthorizationSection.cs
- HttpCookieCollection.cs
- Viewport3DVisual.cs
- MimeBasePart.cs
- CursorConverter.cs
- PointAnimationUsingPath.cs
- ModelUtilities.cs
- LambdaCompiler.Address.cs
- NativeMethods.cs
- DbInsertCommandTree.cs
- BuildManagerHost.cs
- WebEncodingValidatorAttribute.cs
- TdsParser.cs
- NullRuntimeConfig.cs
- XmlUtf8RawTextWriter.cs
- Matrix3DConverter.cs
- XmlIncludeAttribute.cs
- cookie.cs
- Maps.cs
- TextTrailingCharacterEllipsis.cs
- BulletedList.cs
- HttpDateParse.cs
- RoleGroupCollection.cs
- BooleanStorage.cs
- ColorPalette.cs
- UpdateCompiler.cs
- ReflectionPermission.cs
- SQLSingle.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- DependencyObjectCodeDomSerializer.cs
- CapiSafeHandles.cs
- AsyncResult.cs
- AnonymousIdentificationSection.cs
- PriorityBinding.cs
- SafeLocalMemHandle.cs
- ToolStripPanel.cs
- DataGridTable.cs
- CheckBoxBaseAdapter.cs
- CompiledQuery.cs
- HierarchicalDataSourceControl.cs
- ListView.cs
- Binding.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- XmlTextWriter.cs
- DesignTimeXamlWriter.cs
- UserControl.cs
- UriSection.cs
- SafeFileMapViewHandle.cs
- RSAPKCS1SignatureFormatter.cs
- UmAlQuraCalendar.cs
- BitmapEffectGroup.cs
- PerfCounters.cs
- ClientSponsor.cs
- SingleAnimationUsingKeyFrames.cs
- NumericUpDownAcceleration.cs
- DataGridViewCellCollection.cs
- DbConnectionOptions.cs
- SQLGuidStorage.cs
- SynchronizedPool.cs
- CommonObjectSecurity.cs
- CodeComment.cs
- Dynamic.cs
- PauseStoryboard.cs
- OneWayElement.cs
- ListBoxItemWrapperAutomationPeer.cs
- WmlCalendarAdapter.cs
- XmlDigitalSignatureProcessor.cs
- RangeValueProviderWrapper.cs
- MatrixTransform3D.cs
- FormattedTextSymbols.cs
- DockPatternIdentifiers.cs
- XPathConvert.cs
- BitmapVisualManager.cs
- ResourceIDHelper.cs
- CollectionBuilder.cs
- CodeNamespaceCollection.cs
- CapabilitiesAssignment.cs
- UnsafeNativeMethods.cs
- PtsPage.cs
- ConfigurationLocation.cs
- IntegrationExceptionEventArgs.cs
- login.cs
- UrlAuthFailedErrorFormatter.cs
- NativeCompoundFileAPIs.cs