Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / TagMapInfo.cs / 1305376 / 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; 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; 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
- MsmqTransportSecurity.cs
- InvalidEnumArgumentException.cs
- XmlAnyAttributeAttribute.cs
- WinOEToolBoxItem.cs
- WebServiceEnumData.cs
- FileDialog_Vista_Interop.cs
- securitymgrsite.cs
- AppSettingsExpressionBuilder.cs
- XmlHierarchyData.cs
- LoginName.cs
- GCHandleCookieTable.cs
- CustomErrorsSection.cs
- DatatypeImplementation.cs
- RangeValidator.cs
- RIPEMD160Managed.cs
- NavigatingCancelEventArgs.cs
- TextEffectResolver.cs
- DataObjectFieldAttribute.cs
- EndpointIdentityConverter.cs
- ProfileParameter.cs
- ComboBoxAutomationPeer.cs
- RepeatBehaviorConverter.cs
- DataGridViewCellValidatingEventArgs.cs
- UnescapedXmlDiagnosticData.cs
- EntityDataSourceValidationException.cs
- Evidence.cs
- LifetimeServices.cs
- StringFreezingAttribute.cs
- ArgumentOutOfRangeException.cs
- SmtpClient.cs
- WindowsPen.cs
- ChangeTracker.cs
- ChildTable.cs
- PageHandlerFactory.cs
- HtmlObjectListAdapter.cs
- WrappedIUnknown.cs
- CodeGotoStatement.cs
- DocumentApplicationJournalEntry.cs
- SQLBinaryStorage.cs
- PathGeometry.cs
- FrugalMap.cs
- LinqDataSourceValidationException.cs
- StructuralType.cs
- PolicyManager.cs
- OnOperation.cs
- AllMembershipCondition.cs
- StringKeyFrameCollection.cs
- ByteRangeDownloader.cs
- NavigationProperty.cs
- XmlAtomicValue.cs
- NativeWindow.cs
- IPEndPoint.cs
- CallContext.cs
- SoapDocumentServiceAttribute.cs
- SqlTransaction.cs
- KnownTypesHelper.cs
- TimelineGroup.cs
- DataGridCaption.cs
- _SSPISessionCache.cs
- AssemblyAttributesGoHere.cs
- HostExecutionContextManager.cs
- ToolStripMenuItemCodeDomSerializer.cs
- JpegBitmapDecoder.cs
- EndpointConfigContainer.cs
- FontUnit.cs
- EmptyControlCollection.cs
- LineUtil.cs
- DeferredSelectedIndexReference.cs
- ContentFileHelper.cs
- TagNameToTypeMapper.cs
- EnlistmentTraceIdentifier.cs
- TableDetailsRow.cs
- CompleteWizardStep.cs
- FrameworkRichTextComposition.cs
- InputScopeManager.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- M3DUtil.cs
- Accessors.cs
- IIS7WorkerRequest.cs
- MarginsConverter.cs
- RequestCacheEntry.cs
- DataColumnPropertyDescriptor.cs
- DataGridTableCollection.cs
- sapiproxy.cs
- WebPartEventArgs.cs
- GPStream.cs
- DataSourceCollectionBase.cs
- DependencyObjectProvider.cs
- HttpNamespaceReservationInstallComponent.cs
- MULTI_QI.cs
- EntityCommand.cs
- Int16KeyFrameCollection.cs
- DeclarationUpdate.cs
- CommonEndpointBehaviorElement.cs
- Int32AnimationUsingKeyFrames.cs
- SqlParameterCollection.cs
- AsyncStreamReader.cs
- ACE.cs
- SimpleBitVector32.cs
- RawStylusInputCustomData.cs