Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Configuration / TagMapInfo.cs / 5 / 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
- DatagridviewDisplayedBandsData.cs
- NameSpaceExtractor.cs
- ContentFilePart.cs
- BitmapEffectGeneralTransform.cs
- ComponentEditorForm.cs
- DataSourceView.cs
- MeasureItemEvent.cs
- FormattedText.cs
- CellQuery.cs
- _StreamFramer.cs
- AbstractExpressions.cs
- QilExpression.cs
- LZCodec.cs
- XmlProcessingInstruction.cs
- SqlDependency.cs
- ThreadStaticAttribute.cs
- ColorContext.cs
- MarkupCompilePass1.cs
- MoveSizeWinEventHandler.cs
- MetadataCache.cs
- TrackingParameters.cs
- ControlSerializer.cs
- OleDbDataReader.cs
- PropertyGridCommands.cs
- InvalidateEvent.cs
- ToolBarOverflowPanel.cs
- Size3DConverter.cs
- URLMembershipCondition.cs
- GridItemProviderWrapper.cs
- ResourceDefaultValueAttribute.cs
- RefreshPropertiesAttribute.cs
- CallbackDebugBehavior.cs
- DynamicActionMessageFilter.cs
- DbXmlEnabledProviderManifest.cs
- EncodingTable.cs
- MiniCustomAttributeInfo.cs
- _NestedMultipleAsyncResult.cs
- DispatchChannelSink.cs
- IndentedWriter.cs
- Hyperlink.cs
- InfiniteIntConverter.cs
- MessagingDescriptionAttribute.cs
- ProcessInputEventArgs.cs
- BasicViewGenerator.cs
- FastPropertyAccessor.cs
- DataGridTextBoxColumn.cs
- MetadataItemSerializer.cs
- LineGeometry.cs
- SByte.cs
- StructureChangedEventArgs.cs
- JsonWriterDelegator.cs
- _SafeNetHandles.cs
- PropertyTabAttribute.cs
- Aggregates.cs
- ServiceNotStartedException.cs
- DateTimeValueSerializer.cs
- FileClassifier.cs
- List.cs
- NonParentingControl.cs
- CodeParameterDeclarationExpression.cs
- DataListGeneralPage.cs
- MenuTracker.cs
- StringHandle.cs
- XmlSchemaAttributeGroupRef.cs
- ZipIORawDataFileBlock.cs
- webbrowsersite.cs
- TransformPattern.cs
- PointUtil.cs
- ControlTemplate.cs
- TableHeaderCell.cs
- SqlUnionizer.cs
- NativeMethods.cs
- ResXBuildProvider.cs
- LoadGrammarCompletedEventArgs.cs
- Signature.cs
- TypeToken.cs
- RelatedCurrencyManager.cs
- StructureChangedEventArgs.cs
- StackBuilderSink.cs
- AppDomainAttributes.cs
- Point3DConverter.cs
- Border.cs
- EditingCoordinator.cs
- InternalConfigSettingsFactory.cs
- AnnotationResourceChangedEventArgs.cs
- Rotation3DAnimation.cs
- ImageCodecInfo.cs
- AuthenticationModuleElementCollection.cs
- DataTablePropertyDescriptor.cs
- DataSet.cs
- LoginDesignerUtil.cs
- ParallelForEach.cs
- ApplicationTrust.cs
- CharAnimationBase.cs
- NameSpaceEvent.cs
- HttpCacheVaryByContentEncodings.cs
- ChtmlTextBoxAdapter.cs
- SecureEnvironment.cs
- WebControl.cs
- FrameworkContextData.cs