Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / Configuration / ProfilePropertyNameValidator.cs / 1 / ProfilePropertyNameValidator.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Configuration
{
using System;
using System.Xml;
using System.Configuration;
using System.Collections.Specialized;
using System.Collections;
using System.IO;
using System.Text;
using System.Web.Util;
internal sealed class ProfilePropertyNameValidator : ConfigurationValidatorBase
{
public override bool CanValidate(Type type) {
return (type == typeof(string));
}
public override void Validate(object value) {
if (value == null) {
throw new ArgumentNullException("value");
}
string s = value as string;
if (s != null) {
s = s.Trim();
}
if (string.IsNullOrEmpty(s)) {
throw new ArgumentException(SR.GetString(SR.Profile_name_can_not_be_empty));
}
if (s.Contains(".")) {
throw new ArgumentException(SR.GetString(SR.Profile_name_can_not_contain_period));
}
}
internal static ProfilePropertyNameValidator SingletonInstance = new ProfilePropertyNameValidator();
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Configuration
{
using System;
using System.Xml;
using System.Configuration;
using System.Collections.Specialized;
using System.Collections;
using System.IO;
using System.Text;
using System.Web.Util;
internal sealed class ProfilePropertyNameValidator : ConfigurationValidatorBase
{
public override bool CanValidate(Type type) {
return (type == typeof(string));
}
public override void Validate(object value) {
if (value == null) {
throw new ArgumentNullException("value");
}
string s = value as string;
if (s != null) {
s = s.Trim();
}
if (string.IsNullOrEmpty(s)) {
throw new ArgumentException(SR.GetString(SR.Profile_name_can_not_be_empty));
}
if (s.Contains(".")) {
throw new ArgumentException(SR.GetString(SR.Profile_name_can_not_contain_period));
}
}
internal static ProfilePropertyNameValidator SingletonInstance = new ProfilePropertyNameValidator();
}
}
// 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
- FontSource.cs
- DbMetaDataColumnNames.cs
- M3DUtil.cs
- WebDescriptionAttribute.cs
- StrokeNodeOperations2.cs
- RemotingConfigParser.cs
- ConfigurationProperty.cs
- DbDataAdapter.cs
- EncryptedPackage.cs
- DelegatedStream.cs
- SatelliteContractVersionAttribute.cs
- SqlTriggerContext.cs
- __Filters.cs
- InputMethod.cs
- DocumentSchemaValidator.cs
- BaseAppDomainProtocolHandler.cs
- RC2.cs
- CachedRequestParams.cs
- XmlSerializableReader.cs
- RemoteHelper.cs
- DateTimeConverter2.cs
- WebPartVerbsEventArgs.cs
- Base64Encoder.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- UrlAuthorizationModule.cs
- SqlXmlStorage.cs
- NativeObjectSecurity.cs
- SharedPerformanceCounter.cs
- DefaultExpressionVisitor.cs
- SafeTimerHandle.cs
- Mapping.cs
- DataSourceCache.cs
- SizeValueSerializer.cs
- MarshalByRefObject.cs
- XsdDateTime.cs
- CustomCategoryAttribute.cs
- TextSearch.cs
- AutomationPropertyInfo.cs
- QuaternionValueSerializer.cs
- AnnotationHelper.cs
- BlurEffect.cs
- FocusManager.cs
- ActionMessageFilterTable.cs
- DetailsViewPagerRow.cs
- StateMachineAction.cs
- FormsIdentity.cs
- DataGridViewBindingCompleteEventArgs.cs
- StylusPoint.cs
- GroupJoinQueryOperator.cs
- RootBrowserWindowProxy.cs
- HierarchicalDataBoundControl.cs
- FigureParaClient.cs
- DataGridSortCommandEventArgs.cs
- SQLInt32Storage.cs
- OracleConnectionString.cs
- FileNotFoundException.cs
- LayoutEvent.cs
- ImpersonateTokenRef.cs
- AppendHelper.cs
- TableColumn.cs
- CallContext.cs
- CollectionChangedEventManager.cs
- precedingsibling.cs
- ReferenceConverter.cs
- CompletionBookmark.cs
- BitmapData.cs
- ColumnMapTranslator.cs
- ComponentCollection.cs
- Stylus.cs
- InvalidFilterCriteriaException.cs
- AmbientLight.cs
- ConsoleCancelEventArgs.cs
- StrokeNode.cs
- EnvelopedSignatureTransform.cs
- ListBindingHelper.cs
- StringSource.cs
- PageStatePersister.cs
- QilChoice.cs
- ContextInformation.cs
- HGlobalSafeHandle.cs
- QilTypeChecker.cs
- BitFlagsGenerator.cs
- NameTable.cs
- XmlNodeChangedEventArgs.cs
- FileDataSourceCache.cs
- UnsafeNativeMethods.cs
- TreeView.cs
- Selector.cs
- EntityContainerEmitter.cs
- BlockCollection.cs
- File.cs
- HostingEnvironmentSection.cs
- XmlDataProvider.cs
- InvokeWebServiceDesigner.cs
- SiteMapHierarchicalDataSourceView.cs
- CapabilitiesAssignment.cs
- WsatStrings.cs
- ProfileSection.cs
- BaseContextMenu.cs
- CookielessHelper.cs