Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Configuration / TagMapInfo.cs / 1 / TagMapInfo.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; using System.Web.UI; using System.Web.Compilation; using System.Threading; using System.Web.Configuration; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class TagMapInfo : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propTagTypeName = new ConfigurationProperty("tagType", typeof(string), null, null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); private static readonly ConfigurationProperty _propMappedTagTypeName = new ConfigurationProperty("mappedTagType", typeof(string), null, null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired); static TagMapInfo() { _properties = new ConfigurationPropertyCollection(); _properties.Add(_propTagTypeName); _properties.Add(_propMappedTagTypeName); } internal TagMapInfo() { } public TagMapInfo(String tagTypeName, String mappedTagTypeName) : this() { TagType = tagTypeName; MappedTagType = mappedTagTypeName; } public override bool Equals(object o) { TagMapInfo tm = o as TagMapInfo; return StringUtil.Equals(TagType, tm.TagType) && StringUtil.Equals(MappedTagType, tm.MappedTagType); } public override int GetHashCode() { return TagType.GetHashCode() ^ MappedTagType.GetHashCode(); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("mappedTagType")] [StringValidator(MinLength = 1)] public string MappedTagType { get { return (string)base[_propMappedTagTypeName]; } set { base[_propMappedTagTypeName] = value; } } [ConfigurationProperty("tagType", IsRequired = true, IsKey = true, DefaultValue = "")] [StringValidator(MinLength = 1)] public string TagType { get { return (string)base[_propTagTypeName]; } set { base[_propTagTypeName] = value; } } void Verify() { if (String.IsNullOrEmpty(TagType)) { throw new ConfigurationErrorsException( SR.GetString( SR.Config_base_required_attribute_missing, "tagType")); } if (String.IsNullOrEmpty(MappedTagType)) { throw new ConfigurationErrorsException( SR.GetString( SR.Config_base_required_attribute_missing, "mappedTagType")); } } protected override bool SerializeElement(XmlWriter writer, bool serializeCollectionKey) { Verify(); return base.SerializeElement(writer, serializeCollectionKey); } } } // 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; using System.Web.UI; using System.Web.Compilation; using System.Threading; using System.Web.Configuration; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class TagMapInfo : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propTagTypeName = new ConfigurationProperty("tagType", typeof(string), null, null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); private static readonly ConfigurationProperty _propMappedTagTypeName = new ConfigurationProperty("mappedTagType", typeof(string), null, null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired); static TagMapInfo() { _properties = new ConfigurationPropertyCollection(); _properties.Add(_propTagTypeName); _properties.Add(_propMappedTagTypeName); } internal TagMapInfo() { } public TagMapInfo(String tagTypeName, String mappedTagTypeName) : this() { TagType = tagTypeName; MappedTagType = mappedTagTypeName; } public override bool Equals(object o) { TagMapInfo tm = o as TagMapInfo; return StringUtil.Equals(TagType, tm.TagType) && StringUtil.Equals(MappedTagType, tm.MappedTagType); } public override int GetHashCode() { return TagType.GetHashCode() ^ MappedTagType.GetHashCode(); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("mappedTagType")] [StringValidator(MinLength = 1)] public string MappedTagType { get { return (string)base[_propMappedTagTypeName]; } set { base[_propMappedTagTypeName] = value; } } [ConfigurationProperty("tagType", IsRequired = true, IsKey = true, DefaultValue = "")] [StringValidator(MinLength = 1)] public string TagType { get { return (string)base[_propTagTypeName]; } set { base[_propTagTypeName] = value; } } void Verify() { if (String.IsNullOrEmpty(TagType)) { throw new ConfigurationErrorsException( SR.GetString( SR.Config_base_required_attribute_missing, "tagType")); } if (String.IsNullOrEmpty(MappedTagType)) { throw new ConfigurationErrorsException( SR.GetString( SR.Config_base_required_attribute_missing, "mappedTagType")); } } protected override bool SerializeElement(XmlWriter writer, bool serializeCollectionKey) { Verify(); return base.SerializeElement(writer, serializeCollectionKey); } } } // 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
- DataGridAddNewRow.cs
- CngKey.cs
- ValidationRuleCollection.cs
- ControlPager.cs
- Vector3dCollection.cs
- FileUpload.cs
- XmlDocumentSerializer.cs
- ButtonRenderer.cs
- _UncName.cs
- RemotingServices.cs
- ObjectSpanRewriter.cs
- SymLanguageVendor.cs
- Timer.cs
- OdbcDataAdapter.cs
- ProxyElement.cs
- DbgUtil.cs
- ComplexObject.cs
- LoginName.cs
- ClientSettingsStore.cs
- CheckoutException.cs
- DocumentAutomationPeer.cs
- TextProviderWrapper.cs
- EmptyEnumerator.cs
- ContentElementCollection.cs
- hwndwrapper.cs
- ContainerParaClient.cs
- TypeTypeConverter.cs
- DataServiceClientException.cs
- SelectionManager.cs
- UriTemplate.cs
- HttpProfileGroupBase.cs
- ClientTargetSection.cs
- TraceContextEventArgs.cs
- WriteFileContext.cs
- LinqToSqlWrapper.cs
- MethodAccessException.cs
- MasterPage.cs
- ProxyGenerator.cs
- TableDetailsRow.cs
- SqlReorderer.cs
- InputScope.cs
- RotateTransform3D.cs
- SqlPersonalizationProvider.cs
- ListDictionaryInternal.cs
- DelegatingTypeDescriptionProvider.cs
- DependencyPropertyKey.cs
- RelatedEnd.cs
- Bold.cs
- SmuggledIUnknown.cs
- CodeIndexerExpression.cs
- CodeDirectiveCollection.cs
- RetrieveVirtualItemEventArgs.cs
- EventDescriptorCollection.cs
- HebrewCalendar.cs
- ServiceNameElement.cs
- HostedHttpContext.cs
- SafeNativeMethods.cs
- AxHost.cs
- GlyphCache.cs
- RepeaterItemEventArgs.cs
- ProcessHost.cs
- WorkflowItemPresenter.cs
- Compiler.cs
- SystemGatewayIPAddressInformation.cs
- RSAPKCS1KeyExchangeFormatter.cs
- MessageAction.cs
- URLIdentityPermission.cs
- AttributeExtensions.cs
- DBCommand.cs
- PrimitiveSchema.cs
- TableRowGroup.cs
- ElementMarkupObject.cs
- Stacktrace.cs
- CodeDomComponentSerializationService.cs
- Point3DIndependentAnimationStorage.cs
- RelationshipEndMember.cs
- ReferentialConstraint.cs
- DataServiceConfiguration.cs
- ViewEventArgs.cs
- DataGridViewCellStyleChangedEventArgs.cs
- Pts.cs
- BamlTreeNode.cs
- ApplicationId.cs
- AsyncOperationContext.cs
- DependentTransaction.cs
- CompilerWrapper.cs
- RegisteredHiddenField.cs
- DataGridViewMethods.cs
- SelectionService.cs
- Line.cs
- ImageSource.cs
- ModuleBuilderData.cs
- MD5HashHelper.cs
- SqlServer2KCompatibilityCheck.cs
- DocumentPaginator.cs
- basevalidator.cs
- SoapEnumAttribute.cs
- BitmapDownload.cs
- DataAccessor.cs
- DiscoveryClientChannelFactory.cs