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
- RunWorkerCompletedEventArgs.cs
- DataSourceView.cs
- SQLChars.cs
- InArgumentConverter.cs
- Matrix.cs
- CodeMemberProperty.cs
- ListMarkerSourceInfo.cs
- FixedSOMPageConstructor.cs
- X509SubjectKeyIdentifierClause.cs
- OrderByQueryOptionExpression.cs
- TlsnegoTokenAuthenticator.cs
- GAC.cs
- TraceListener.cs
- AnnotationResourceChangedEventArgs.cs
- DynamicRendererThreadManager.cs
- DataRecordObjectView.cs
- _MultipleConnectAsync.cs
- EventRecordWrittenEventArgs.cs
- UserPreferenceChangedEventArgs.cs
- TextFormattingConverter.cs
- TableLayoutStyle.cs
- ResourceDictionaryCollection.cs
- CheckBoxStandardAdapter.cs
- FastEncoder.cs
- EllipticalNodeOperations.cs
- DataBoundControlDesigner.cs
- PowerModeChangedEventArgs.cs
- SystemPens.cs
- Visitors.cs
- IntPtr.cs
- InvalidComObjectException.cs
- SqlDeflator.cs
- Signature.cs
- Rfc2898DeriveBytes.cs
- IDispatchConstantAttribute.cs
- Atom10ItemFormatter.cs
- ClrPerspective.cs
- HostedNamedPipeTransportManager.cs
- ClientTarget.cs
- GeometryValueSerializer.cs
- Int32Collection.cs
- FacetValues.cs
- BoundColumn.cs
- KnownBoxes.cs
- AnyReturnReader.cs
- RegexTree.cs
- IsolatedStorageFile.cs
- DataGridColumnCollection.cs
- AuthenticodeSignatureInformation.cs
- LedgerEntryCollection.cs
- OneOfScalarConst.cs
- ReferentialConstraint.cs
- FontResourceCache.cs
- CollectionViewProxy.cs
- EdgeModeValidation.cs
- SchemaLookupTable.cs
- ServiceModelActivity.cs
- RootBrowserWindowAutomationPeer.cs
- XmlComment.cs
- ControlValuePropertyAttribute.cs
- StringDictionary.cs
- X509Certificate2Collection.cs
- ScriptIgnoreAttribute.cs
- ClientBuildManagerCallback.cs
- TextServicesDisplayAttributePropertyRanges.cs
- PassportPrincipal.cs
- MediaContext.cs
- LifetimeManager.cs
- XmlSchemaExporter.cs
- StrokeCollectionConverter.cs
- NavigationHelper.cs
- HatchBrush.cs
- Exception.cs
- PartialArray.cs
- HandlerWithFactory.cs
- CommonDialog.cs
- RegisteredScript.cs
- SqlXml.cs
- StyleCollectionEditor.cs
- TypeValidationEventArgs.cs
- Formatter.cs
- InputMethodStateTypeInfo.cs
- CommandBindingCollection.cs
- FacetDescriptionElement.cs
- Models.cs
- EntityDataSourceStatementEditor.cs
- ObjectParameter.cs
- SessionEndingEventArgs.cs
- HttpServerVarsCollection.cs
- FormatterConverter.cs
- ConfigurationStrings.cs
- ScrollableControl.cs
- XmlReflectionImporter.cs
- WriteTimeStream.cs
- SizeAnimationClockResource.cs
- TrackingServices.cs
- CalendarData.cs
- ReservationCollection.cs
- BinaryObjectReader.cs
- input.cs