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
- TemplateKeyConverter.cs
- Odbc32.cs
- SamlNameIdentifierClaimResource.cs
- CalendarDesigner.cs
- XmlSchemaFacet.cs
- _NestedSingleAsyncResult.cs
- ProfilePropertyNameValidator.cs
- IdentityModelDictionary.cs
- ConnectionStringsSection.cs
- HttpResponse.cs
- ClientOperation.cs
- ColorPalette.cs
- AutoGeneratedField.cs
- DBDataPermission.cs
- WebPartConnectionsConnectVerb.cs
- WindowVisualStateTracker.cs
- ParameterBuilder.cs
- TextLineBreak.cs
- Triangle.cs
- CodeMethodReturnStatement.cs
- XPathAxisIterator.cs
- MessageBox.cs
- SystemInformation.cs
- GridItem.cs
- PermissionSet.cs
- ColorConverter.cs
- FixedTextSelectionProcessor.cs
- Pkcs9Attribute.cs
- FixedSOMFixedBlock.cs
- PreservationFileWriter.cs
- QuotedPairReader.cs
- TextTreeInsertUndoUnit.cs
- HashCodeCombiner.cs
- ImageDrawing.cs
- HotSpotCollection.cs
- DictionaryEntry.cs
- ProfileGroupSettings.cs
- ConfigurationManagerInternalFactory.cs
- StructuralCache.cs
- SqlGenericUtil.cs
- WebPartDescriptionCollection.cs
- Form.cs
- Events.cs
- XPathItem.cs
- Errors.cs
- FunctionImportMapping.cs
- HttpModuleCollection.cs
- WebPartsSection.cs
- SHA512Managed.cs
- ExpressionEditor.cs
- DBParameter.cs
- initElementDictionary.cs
- ExceptionTrace.cs
- PlainXmlSerializer.cs
- SizeConverter.cs
- Decoder.cs
- AspCompat.cs
- OneToOneMappingSerializer.cs
- ConfigurationManagerHelperFactory.cs
- GridViewHeaderRowPresenter.cs
- BasePropertyDescriptor.cs
- AsymmetricKeyExchangeDeformatter.cs
- RepeatButtonAutomationPeer.cs
- List.cs
- WaitHandle.cs
- ByteAnimationUsingKeyFrames.cs
- FontEditor.cs
- Header.cs
- FontUnit.cs
- XmlAttributeCollection.cs
- MsmqChannelFactory.cs
- InitializerFacet.cs
- ButtonFieldBase.cs
- SimpleTypeResolver.cs
- ComponentResourceManager.cs
- XsdDataContractImporter.cs
- BevelBitmapEffect.cs
- NameObjectCollectionBase.cs
- GregorianCalendar.cs
- basenumberconverter.cs
- BCLDebug.cs
- ToolBarButtonClickEvent.cs
- COM2Properties.cs
- OperandQuery.cs
- HttpRuntimeSection.cs
- TemplateXamlParser.cs
- PassportIdentity.cs
- TableChangeProcessor.cs
- TextEmbeddedObject.cs
- FileDocument.cs
- DuplicateDetector.cs
- RangeValueProviderWrapper.cs
- GridViewCancelEditEventArgs.cs
- RoleGroupCollection.cs
- EllipseGeometry.cs
- SymLanguageVendor.cs
- XAMLParseException.cs
- WebPartActionVerb.cs
- DataSourceProvider.cs
- ExtensibleClassFactory.cs