Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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.
//
//-----------------------------------------------------------------------------
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
- ListItemCollection.cs
- InputScopeManager.cs
- ListChangedEventArgs.cs
- ParserExtension.cs
- NamespaceList.cs
- MediaCommands.cs
- UIElementCollection.cs
- WebPartVerb.cs
- SchemaCreator.cs
- StrongNameKeyPair.cs
- SubqueryRules.cs
- OrderedDictionary.cs
- DbModificationClause.cs
- SharedPersonalizationStateInfo.cs
- XmlDictionaryReaderQuotasElement.cs
- ErrorTableItemStyle.cs
- SoapIncludeAttribute.cs
- MatrixCamera.cs
- KerberosTokenFactoryCredential.cs
- RuleDefinitions.cs
- DecimalStorage.cs
- XPathItem.cs
- WebBaseEventKeyComparer.cs
- SmiMetaData.cs
- Relationship.cs
- VerificationException.cs
- FlowDocumentPageViewerAutomationPeer.cs
- BlurEffect.cs
- PointAnimationBase.cs
- DebugView.cs
- MetafileHeaderWmf.cs
- If.cs
- Context.cs
- TextBoxBase.cs
- DuplexSecurityProtocolFactory.cs
- TextBox.cs
- DataMemberListEditor.cs
- Wrapper.cs
- CryptoSession.cs
- PropertyNames.cs
- HitTestParameters3D.cs
- XPathNodeList.cs
- Evidence.cs
- SqlClientWrapperSmiStream.cs
- InkPresenter.cs
- ScriptBehaviorDescriptor.cs
- EventPropertyMap.cs
- SQLInt16.cs
- LogRestartAreaEnumerator.cs
- BatchParser.cs
- InstanceCompleteException.cs
- RemotingSurrogateSelector.cs
- IEnumerable.cs
- HandlerFactoryCache.cs
- XhtmlBasicValidatorAdapter.cs
- ContextMenuStripGroup.cs
- DataRowExtensions.cs
- ListCollectionView.cs
- SafeRightsManagementSessionHandle.cs
- EmptyCollection.cs
- Properties.cs
- OracleConnectionFactory.cs
- CompilerResults.cs
- EntityDataSourceUtil.cs
- ContainerUIElement3D.cs
- TaskFileService.cs
- XamlInt32CollectionSerializer.cs
- DropTarget.cs
- ProtocolsConfigurationEntry.cs
- StartUpEventArgs.cs
- Not.cs
- MarkupObject.cs
- GeometryCollection.cs
- MsmqProcessProtocolHandler.cs
- ButtonFieldBase.cs
- BitmapPalette.cs
- CheckoutException.cs
- HtmlInputCheckBox.cs
- MemberDomainMap.cs
- TiffBitmapDecoder.cs
- AnimationClockResource.cs
- TypedReference.cs
- ToolStripOverflowButton.cs
- ResponseBodyWriter.cs
- SupportingTokenListenerFactory.cs
- FacetChecker.cs
- GridEntry.cs
- Task.cs
- HttpResponseWrapper.cs
- MdImport.cs
- BamlTreeUpdater.cs
- WebHeaderCollection.cs
- TableLayoutStyle.cs
- OleAutBinder.cs
- ProgressBarBrushConverter.cs
- UshortList2.cs
- ProtocolsSection.cs
- BitmapFrameEncode.cs
- XmlObjectSerializerReadContext.cs
- _KerberosClient.cs