Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / ProfilePropertyNameValidator.cs / 1305376 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CultureTableRecord.cs
- HttpListenerException.cs
- Expander.cs
- MainMenu.cs
- TypedTableBaseExtensions.cs
- HotCommands.cs
- Stream.cs
- KeyInterop.cs
- NumericUpDownAcceleration.cs
- ProjectionNode.cs
- WindowsAuthenticationModule.cs
- DispatcherExceptionFilterEventArgs.cs
- SectionXmlInfo.cs
- Mappings.cs
- DataGridRowHeader.cs
- ListenerTraceUtility.cs
- DiscoveryReference.cs
- ComplexBindingPropertiesAttribute.cs
- IfJoinedCondition.cs
- PackageRelationshipCollection.cs
- CounterCreationData.cs
- XmlSchemaRedefine.cs
- RadioButtonPopupAdapter.cs
- ServiceContractGenerationContext.cs
- BaseComponentEditor.cs
- CacheRequest.cs
- XmlWriter.cs
- ResolveNameEventArgs.cs
- ClientFormsAuthenticationCredentials.cs
- ToolStripContainer.cs
- ClonableStack.cs
- SecondaryIndexList.cs
- KerberosRequestorSecurityToken.cs
- DeviceSpecificChoiceCollection.cs
- Span.cs
- IChannel.cs
- CodeExpressionRuleDeclaration.cs
- RootBuilder.cs
- DoubleCollectionConverter.cs
- PasswordRecoveryDesigner.cs
- JournalEntry.cs
- ReadonlyMessageFilter.cs
- HeaderUtility.cs
- WindowsListViewScroll.cs
- SQLInt32.cs
- SystemMulticastIPAddressInformation.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- FactoryGenerator.cs
- ObjectCloneHelper.cs
- ListDictionaryInternal.cs
- AttachInfo.cs
- Input.cs
- CodeObject.cs
- DesignTimeVisibleAttribute.cs
- CopyCodeAction.cs
- BuildProvider.cs
- ListViewCommandEventArgs.cs
- ThousandthOfEmRealPoints.cs
- Positioning.cs
- ManipulationPivot.cs
- DataFormat.cs
- DocComment.cs
- _SingleItemRequestCache.cs
- WebDisplayNameAttribute.cs
- Application.cs
- XmlComplianceUtil.cs
- EncoderFallback.cs
- ProfileInfo.cs
- DisplayInformation.cs
- ComponentDispatcher.cs
- ToolStripGripRenderEventArgs.cs
- CaretElement.cs
- UIServiceHelper.cs
- TryCatchDesigner.xaml.cs
- LineSegment.cs
- DataServiceRequest.cs
- wgx_commands.cs
- EntitySetBaseCollection.cs
- ToolStripDropDownMenu.cs
- XmlDataImplementation.cs
- NameTable.cs
- _NetworkingPerfCounters.cs
- GridLength.cs
- BookmarkEventArgs.cs
- BackgroundFormatInfo.cs
- SoapSchemaMember.cs
- MissingMethodException.cs
- ParseChildrenAsPropertiesAttribute.cs
- DomainUpDown.cs
- ListItemsPage.cs
- MarkupCompilePass2.cs
- CellRelation.cs
- WorkflowDesigner.cs
- FixedDocumentSequencePaginator.cs
- ContractHandle.cs
- SoundPlayer.cs
- DbFunctionCommandTree.cs
- ObjectContextServiceProvider.cs
- TextTreeUndo.cs
- XmlEventCache.cs