Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TransformerInfoCollection.cs
- base64Transforms.cs
- DateTimeUtil.cs
- Char.cs
- TransportConfigurationTypeElement.cs
- XmlSchemaAttributeGroup.cs
- UpdatePanelControlTrigger.cs
- ApplicationActivator.cs
- TabControlCancelEvent.cs
- CorePropertiesFilter.cs
- ConsumerConnectionPoint.cs
- AppDomainFactory.cs
- DeferredReference.cs
- QilNode.cs
- DoubleConverter.cs
- CreateUserWizardDesigner.cs
- ReferenceEqualityComparer.cs
- DownloadProgressEventArgs.cs
- BuildTopDownAttribute.cs
- ProcessActivityTreeOptions.cs
- ProcessModelInfo.cs
- DragStartedEventArgs.cs
- HyperlinkAutomationPeer.cs
- PriorityBindingExpression.cs
- SymmetricKey.cs
- WebPartUtil.cs
- SHA1.cs
- AttributeEmitter.cs
- AnimationLayer.cs
- CacheAxisQuery.cs
- Substitution.cs
- Perspective.cs
- ApplicationInfo.cs
- ElementAtQueryOperator.cs
- SemanticTag.cs
- OperationResponse.cs
- GroupItem.cs
- XNameConverter.cs
- SafeNativeMethods.cs
- CompressionTracing.cs
- URLString.cs
- ToolboxItemImageConverter.cs
- Literal.cs
- MultiAsyncResult.cs
- SafeNativeMethodsCLR.cs
- ClusterSafeNativeMethods.cs
- SizeF.cs
- LineVisual.cs
- ContractListAdapter.cs
- InternalUserCancelledException.cs
- DataContractSerializer.cs
- Knowncolors.cs
- ClientRolePrincipal.cs
- InternalTypeHelper.cs
- StateBag.cs
- RtfFormatStack.cs
- sqlmetadatafactory.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- messageonlyhwndwrapper.cs
- GeneralTransform3DGroup.cs
- CriticalHandle.cs
- SendAgentStatusRequest.cs
- ImageClickEventArgs.cs
- TargetConverter.cs
- TextProperties.cs
- ObservableDictionary.cs
- HashCodeCombiner.cs
- SpoolingTaskBase.cs
- StringFunctions.cs
- BinaryConverter.cs
- MailAddressParser.cs
- SpellCheck.cs
- SlotInfo.cs
- BindingManagerDataErrorEventArgs.cs
- BatchStream.cs
- LocationSectionRecord.cs
- Thickness.cs
- RemoveStoryboard.cs
- HttpPostLocalhostServerProtocol.cs
- SqlCommandBuilder.cs
- TrimSurroundingWhitespaceAttribute.cs
- WindowsListViewItem.cs
- TokenBasedSet.cs
- GlyphInfoList.cs
- NativeCppClassAttribute.cs
- input.cs
- ThicknessAnimation.cs
- PropertyGridEditorPart.cs
- UIntPtr.cs
- IntMinMaxAggregationOperator.cs
- ADMembershipUser.cs
- ContextMenu.cs
- RectangleGeometry.cs
- Color.cs
- EndEvent.cs
- Guid.cs
- EditorBrowsableAttribute.cs
- SplitContainerDesigner.cs
- AdjustableArrowCap.cs
- TableRowGroupCollection.cs