Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ScrollViewerAutomationPeer.cs
- ConfigurationSchemaErrors.cs
- DataRowComparer.cs
- KeyValuePair.cs
- TransformValueSerializer.cs
- DataSourceConverter.cs
- IUnknownConstantAttribute.cs
- QueryableDataSourceView.cs
- MailBnfHelper.cs
- ClientScriptManagerWrapper.cs
- TextEffect.cs
- EntityDataSourceReferenceGroup.cs
- SessionStateModule.cs
- SafeMemoryMappedFileHandle.cs
- PtsPage.cs
- RemotingConfiguration.cs
- Trigger.cs
- MetaDataInfo.cs
- QuadraticBezierSegment.cs
- LogPolicy.cs
- TransformCollection.cs
- DesignerAttribute.cs
- DataGridViewTopLeftHeaderCell.cs
- ObjectDataSourceWizardForm.cs
- ExpressionEvaluator.cs
- State.cs
- MaskInputRejectedEventArgs.cs
- CardSpaceException.cs
- BufferedResponseStream.cs
- FaultConverter.cs
- ConcurrentDictionary.cs
- WebBrowserUriTypeConverter.cs
- CLSCompliantAttribute.cs
- TextBox.cs
- MatrixTransform.cs
- _LocalDataStore.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- ThreadSafeList.cs
- __FastResourceComparer.cs
- FixedSOMPageElement.cs
- VBIdentifierName.cs
- SqlDependencyUtils.cs
- RtfControls.cs
- BindValidator.cs
- KeyedCollection.cs
- FuncCompletionCallbackWrapper.cs
- ScriptResourceAttribute.cs
- DataGridViewIntLinkedList.cs
- SegmentInfo.cs
- ObjectSpanRewriter.cs
- securitycriticaldataformultiplegetandset.cs
- SchemaType.cs
- HandlerWithFactory.cs
- XmlCodeExporter.cs
- EntityDataSourceContextCreatingEventArgs.cs
- PasswordRecoveryDesigner.cs
- TrustSection.cs
- FormatSettings.cs
- HtmlTextArea.cs
- SoapCommonClasses.cs
- AQNBuilder.cs
- CmsInterop.cs
- As.cs
- EventHandlerList.cs
- PageRouteHandler.cs
- EmptyCollection.cs
- StylusDownEventArgs.cs
- BamlCollectionHolder.cs
- BindingContext.cs
- IIS7WorkerRequest.cs
- AdapterDictionary.cs
- FrameworkElement.cs
- CodeTypeParameterCollection.cs
- AutomationIdentifier.cs
- EditorPartCollection.cs
- XmlUtil.cs
- RelationshipSet.cs
- TablePattern.cs
- RoutedEventHandlerInfo.cs
- CloudCollection.cs
- SchemaMapping.cs
- StaticExtensionConverter.cs
- RawMouseInputReport.cs
- SqlPersonalizationProvider.cs
- DBSchemaTable.cs
- AstTree.cs
- CellQuery.cs
- TimeSpanValidatorAttribute.cs
- ConnectionStringsSection.cs
- IRCollection.cs
- BufferBuilder.cs
- HttpMethodConstraint.cs
- Message.cs
- _TimerThread.cs
- FormsAuthenticationCredentials.cs
- SiblingIterators.cs
- FrameSecurityDescriptor.cs
- TextBoxAutomationPeer.cs
- DoubleAverageAggregationOperator.cs
- Transform3DGroup.cs