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
- Size3DValueSerializer.cs
- DBSchemaTable.cs
- DependencyObject.cs
- PlainXmlSerializer.cs
- DiscoveryReferences.cs
- OperationCanceledException.cs
- PassportIdentity.cs
- DynamicResourceExtension.cs
- Ray3DHitTestResult.cs
- NavigationFailedEventArgs.cs
- TableRow.cs
- SecurityTokenProvider.cs
- ScriptIgnoreAttribute.cs
- SHA256Managed.cs
- AliasedSlot.cs
- SqlConnectionManager.cs
- OleDbStruct.cs
- CommandLibraryHelper.cs
- Point3DAnimationBase.cs
- ListDataHelper.cs
- MergeFailedEvent.cs
- JoinSymbol.cs
- ExponentialEase.cs
- DataGridViewSelectedCellCollection.cs
- WebCategoryAttribute.cs
- NetSectionGroup.cs
- CreateParams.cs
- FloaterBaseParagraph.cs
- DetailsViewDeletedEventArgs.cs
- DbDataReader.cs
- TableRowCollection.cs
- BroadcastEventHelper.cs
- ConsoleTraceListener.cs
- TextSegment.cs
- SafeTokenHandle.cs
- DesignerActionUIStateChangeEventArgs.cs
- RTTypeWrapper.cs
- IOException.cs
- MSG.cs
- AggregateException.cs
- XmlSchemaAny.cs
- ConstraintEnumerator.cs
- ChangeNode.cs
- XPathDocument.cs
- DataGridTextBox.cs
- HexParser.cs
- DesignerActionUIStateChangeEventArgs.cs
- TabControl.cs
- DeclaredTypeValidatorAttribute.cs
- DESCryptoServiceProvider.cs
- XmlDocument.cs
- LineMetrics.cs
- Match.cs
- LayoutTableCell.cs
- Utils.cs
- SystemColors.cs
- XmlCharCheckingReader.cs
- GroupBoxAutomationPeer.cs
- MenuTracker.cs
- Frame.cs
- X509Chain.cs
- KeyProperty.cs
- SqlDataSourceStatusEventArgs.cs
- ShapeTypeface.cs
- StringBuilder.cs
- AnnotationDocumentPaginator.cs
- BuilderPropertyEntry.cs
- RecordsAffectedEventArgs.cs
- HtmlContainerControl.cs
- TableLayoutCellPaintEventArgs.cs
- CodeDomSerializerException.cs
- FrameSecurityDescriptor.cs
- FlowNode.cs
- HostProtectionException.cs
- BamlResourceContent.cs
- WebHttpBindingElement.cs
- ControlBindingsConverter.cs
- ToolBarOverflowPanel.cs
- WebFaultClientMessageInspector.cs
- TextRenderer.cs
- Rectangle.cs
- BlockCollection.cs
- RenderData.cs
- Tile.cs
- XmlSchemaSimpleContent.cs
- _Rfc2616CacheValidators.cs
- DesignerProperties.cs
- SqlDataSourceEnumerator.cs
- MDIClient.cs
- ObjectPropertyMapping.cs
- UnknownBitmapDecoder.cs
- WindowsFormsHost.cs
- MSAANativeProvider.cs
- WindowsGrip.cs
- TimeSpanValidatorAttribute.cs
- PathFigureCollection.cs
- MobileCategoryAttribute.cs
- TableColumn.cs
- RowBinding.cs
- TabPage.cs