Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / TagMapInfo.cs / 2 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Regex.cs
- FrameworkContentElementAutomationPeer.cs
- _ConnectStream.cs
- AssemblyAttributes.cs
- NativeMethodsOther.cs
- DbProviderManifest.cs
- TabControl.cs
- TableRowGroup.cs
- SynthesizerStateChangedEventArgs.cs
- XmlReaderSettings.cs
- MetadataException.cs
- SqlSelectStatement.cs
- ErrorFormatterPage.cs
- ProfileProvider.cs
- EventSinkHelperWriter.cs
- GridViewEditEventArgs.cs
- Parser.cs
- CellTreeSimplifier.cs
- Win32Native.cs
- DataStorage.cs
- DataReaderContainer.cs
- TreeNode.cs
- ConditionalBranch.cs
- _SslSessionsCache.cs
- UmAlQuraCalendar.cs
- BitmapCache.cs
- _CacheStreams.cs
- AlignmentYValidation.cs
- FontStyles.cs
- ServiceContractViewControl.Designer.cs
- DataObject.cs
- OleDbDataAdapter.cs
- PrimitiveXmlSerializers.cs
- ImageIndexConverter.cs
- ExpressionBuilderCollection.cs
- DefaultSerializationProviderAttribute.cs
- ResourceSet.cs
- SqlInfoMessageEvent.cs
- ArgIterator.cs
- TextBoxRenderer.cs
- MetabaseSettings.cs
- Latin1Encoding.cs
- DataGridHelper.cs
- ThreadExceptionDialog.cs
- HttpAsyncResult.cs
- DrawingContextWalker.cs
- SchemaImporterExtensionsSection.cs
- EtwTrace.cs
- Site.cs
- BitArray.cs
- UDPClient.cs
- BitmapPalette.cs
- ConnectionProviderAttribute.cs
- CheckPair.cs
- LoadMessageLogger.cs
- EnvironmentPermission.cs
- TdsParameterSetter.cs
- ObjectSet.cs
- DataGridColumnEventArgs.cs
- QueryableDataSourceEditData.cs
- X509WindowsSecurityToken.cs
- GradientBrush.cs
- COM2Properties.cs
- SevenBitStream.cs
- XmlMemberMapping.cs
- XPathAncestorIterator.cs
- DescendentsWalkerBase.cs
- RotateTransform3D.cs
- TimeSpanValidator.cs
- FileAuthorizationModule.cs
- TrustLevelCollection.cs
- SortableBindingList.cs
- ExceptionUtil.cs
- AuthorizationRuleCollection.cs
- InstancePersistenceEvent.cs
- TreeView.cs
- ActivationServices.cs
- PingReply.cs
- ByteAnimation.cs
- EmptyControlCollection.cs
- SafeTokenHandle.cs
- SafeHandle.cs
- ObservableCollection.cs
- SerialStream.cs
- EtwTrace.cs
- AuthenticationService.cs
- TemplateControl.cs
- BulletedList.cs
- Sentence.cs
- TouchesCapturedWithinProperty.cs
- BoundPropertyEntry.cs
- ArrayWithOffset.cs
- SamlAssertionKeyIdentifierClause.cs
- XmlILIndex.cs
- Boolean.cs
- securestring.cs
- ScrollProviderWrapper.cs
- OutputCacheSection.cs
- TemplateContent.cs
- OdbcConnectionFactory.cs