Code:
/ FX-1434 / FX-1434 / 1.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
- PowerModeChangedEventArgs.cs
- AutomationEvent.cs
- XmlSchemaImporter.cs
- XmlMessageFormatter.cs
- TypeBuilder.cs
- PackageProperties.cs
- DES.cs
- EventTask.cs
- Int64Animation.cs
- ConstructorExpr.cs
- FileDialogCustomPlace.cs
- ResourceDisplayNameAttribute.cs
- FastPropertyAccessor.cs
- Renderer.cs
- DateTimeFormatInfo.cs
- CompilationPass2TaskInternal.cs
- CultureInfo.cs
- TripleDES.cs
- SafeThreadHandle.cs
- SqlDataSource.cs
- XmlSerializableServices.cs
- GifBitmapDecoder.cs
- PagedDataSource.cs
- UpdateRecord.cs
- XPathMultyIterator.cs
- FloaterBaseParaClient.cs
- XXXInfos.cs
- FileDialogCustomPlaces.cs
- Exceptions.cs
- WebUtil.cs
- MemberInfoSerializationHolder.cs
- WsatServiceAddress.cs
- BoundColumn.cs
- SnapLine.cs
- UseLicense.cs
- DictionarySectionHandler.cs
- TypeConverter.cs
- CssClassPropertyAttribute.cs
- OdbcParameterCollection.cs
- BinHexDecoder.cs
- EncryptedKey.cs
- StrictAndMessageFilter.cs
- DataBoundControlDesigner.cs
- CheckBox.cs
- PenThreadPool.cs
- MatrixCamera.cs
- BinaryObjectReader.cs
- StreamWriter.cs
- DPTypeDescriptorContext.cs
- Shape.cs
- StackOverflowException.cs
- XmlSchemaIdentityConstraint.cs
- DesignerObjectListAdapter.cs
- HttpCacheVary.cs
- ConfigurationManagerHelper.cs
- ServiceNotStartedException.cs
- KoreanLunisolarCalendar.cs
- TextElementAutomationPeer.cs
- XmlSchema.cs
- X509ScopedServiceCertificateElementCollection.cs
- ISessionStateStore.cs
- Tool.cs
- SetStateDesigner.cs
- EventRouteFactory.cs
- TextParaClient.cs
- SimpleMailWebEventProvider.cs
- RevocationPoint.cs
- MruCache.cs
- GridViewRow.cs
- BidOverLoads.cs
- HttpClientCertificate.cs
- EncryptedKey.cs
- Util.cs
- TextBoxLine.cs
- InteropExecutor.cs
- SessionPageStateSection.cs
- SecurityDescriptor.cs
- Rule.cs
- SvcMapFileLoader.cs
- TypeContext.cs
- Facet.cs
- PersonalizableTypeEntry.cs
- wmiprovider.cs
- DirectionalLight.cs
- Faults.cs
- PaperSource.cs
- FrameworkPropertyMetadata.cs
- ObservableCollection.cs
- DataGrid.cs
- BooleanToVisibilityConverter.cs
- SafeLocalAllocation.cs
- SqlClientPermission.cs
- DataGridViewCell.cs
- CompatibleComparer.cs
- TaiwanCalendar.cs
- SourceItem.cs
- HttpModulesSection.cs
- XmlSerializationWriter.cs
- LassoSelectionBehavior.cs
- BitStream.cs