Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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();
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ServiceBehaviorElement.cs
- InternalConfigEventArgs.cs
- Classification.cs
- SamlAuthenticationClaimResource.cs
- Object.cs
- DbMetaDataCollectionNames.cs
- NegotiateStream.cs
- XmlTypeMapping.cs
- WarningException.cs
- XhtmlBasicFormAdapter.cs
- Wizard.cs
- PropertyDescriptorCollection.cs
- KeyboardDevice.cs
- DocumentGridPage.cs
- NotFiniteNumberException.cs
- PathBox.cs
- TypeSchema.cs
- EntityExpressionVisitor.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- SchemaUtility.cs
- DataGridState.cs
- ThreadExceptionEvent.cs
- _ListenerAsyncResult.cs
- SchemaTypeEmitter.cs
- unsafenativemethodsother.cs
- SByte.cs
- SocketInformation.cs
- IListConverters.cs
- CharacterBufferReference.cs
- TableLayoutRowStyleCollection.cs
- WebHttpSecurityModeHelper.cs
- WrappedKeySecurityTokenParameters.cs
- PropertyEntry.cs
- WebServiceBindingAttribute.cs
- CodeDomComponentSerializationService.cs
- ProbeDuplexAsyncResult.cs
- XamlFigureLengthSerializer.cs
- TabItem.cs
- FormViewPagerRow.cs
- ConfigurationFileMap.cs
- NotifyParentPropertyAttribute.cs
- SqlDataSourceConfigureFilterForm.cs
- ScrollContentPresenter.cs
- ParameterRetriever.cs
- PolicyException.cs
- TextStore.cs
- HwndKeyboardInputProvider.cs
- MouseGesture.cs
- EnumBuilder.cs
- ResourceExpression.cs
- Vector.cs
- Rule.cs
- TcpActivation.cs
- ThreadWorkerController.cs
- BooleanStorage.cs
- ExcCanonicalXml.cs
- WebPartDesigner.cs
- ApplicationGesture.cs
- Vector3dCollection.cs
- _ServiceNameStore.cs
- DebuggerAttributes.cs
- DataGridClipboardHelper.cs
- NodeLabelEditEvent.cs
- SqlConnectionStringBuilder.cs
- SqlMethodTransformer.cs
- ResXDataNode.cs
- ComplexPropertyEntry.cs
- DeclarativeExpressionConditionDeclaration.cs
- DesignerVerb.cs
- ButtonAutomationPeer.cs
- Point3DAnimationUsingKeyFrames.cs
- JsonClassDataContract.cs
- WebPartPersonalization.cs
- DataPager.cs
- SmiConnection.cs
- LogicalTreeHelper.cs
- UIElement3D.cs
- MarkupExtensionReturnTypeAttribute.cs
- EUCJPEncoding.cs
- StylusOverProperty.cs
- RubberbandSelector.cs
- DelegatingTypeDescriptionProvider.cs
- XmlDataLoader.cs
- SymbolDocumentInfo.cs
- HtmlHistory.cs
- VectorAnimation.cs
- EditorZone.cs
- TabControl.cs
- Process.cs
- DetailsViewUpdateEventArgs.cs
- processwaithandle.cs
- HMACSHA1.cs
- ErasingStroke.cs
- ValidatorCompatibilityHelper.cs
- ActivitySurrogateSelector.cs
- ProviderException.cs
- regiisutil.cs
- ObjectViewQueryResultData.cs
- ExtendedPropertyCollection.cs
- DataServiceStreamResponse.cs