Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / 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. //------------------------------------------------------------------------------ //// 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
- ProfileBuildProvider.cs
- PartialTrustHelpers.cs
- SessionEndedEventArgs.cs
- EdmTypeAttribute.cs
- LineGeometry.cs
- TheQuery.cs
- NamedPipeChannelListener.cs
- ExpandSegmentCollection.cs
- ListBoxChrome.cs
- ArrayHelper.cs
- AppDomainProtocolHandler.cs
- cache.cs
- RequestTimeoutManager.cs
- DaylightTime.cs
- URLString.cs
- TdsParserStateObject.cs
- NetworkStream.cs
- HttpModuleActionCollection.cs
- Dump.cs
- ILGenerator.cs
- ToolboxDataAttribute.cs
- IntegerValidatorAttribute.cs
- WorkflowApplicationCompletedEventArgs.cs
- TextViewBase.cs
- controlskin.cs
- TextSelectionHighlightLayer.cs
- LambdaCompiler.Statements.cs
- ExternalException.cs
- DependencyPropertyHelper.cs
- EntityClientCacheKey.cs
- MethodSet.cs
- TextView.cs
- XmlSerializerVersionAttribute.cs
- UnhandledExceptionEventArgs.cs
- WebPartChrome.cs
- xamlnodes.cs
- Debug.cs
- DES.cs
- BuilderPropertyEntry.cs
- BaseCollection.cs
- SerialReceived.cs
- cryptoapiTransform.cs
- AnnotationElement.cs
- SessionStateItemCollection.cs
- CompilerTypeWithParams.cs
- AttachedPropertyBrowsableAttribute.cs
- StringValueSerializer.cs
- UserUseLicenseDictionaryLoader.cs
- GridViewSortEventArgs.cs
- MemberExpressionHelper.cs
- MeasureData.cs
- ThumbAutomationPeer.cs
- ProtocolsConfigurationHandler.cs
- ListViewItem.cs
- DocumentEventArgs.cs
- MediaContextNotificationWindow.cs
- ActionNotSupportedException.cs
- XmlMapping.cs
- BinaryObjectInfo.cs
- XmlSerializerFactory.cs
- InputLangChangeEvent.cs
- DbDataAdapter.cs
- OrthographicCamera.cs
- VolatileResourceManager.cs
- EnumUnknown.cs
- HtmlTitle.cs
- FragmentQueryProcessor.cs
- CustomMenuItemCollection.cs
- DefaultMemberAttribute.cs
- FromReply.cs
- ObjectStateEntry.cs
- ApplyHostConfigurationBehavior.cs
- DescendantBaseQuery.cs
- EventManager.cs
- ComponentDispatcher.cs
- figurelength.cs
- SiteMap.cs
- SettingsContext.cs
- DispatcherEventArgs.cs
- Funcletizer.cs
- CollectionEditorDialog.cs
- serverconfig.cs
- SizeAnimationBase.cs
- filewebrequest.cs
- ToolStripDropDownClosingEventArgs.cs
- SelectionItemPattern.cs
- RenderData.cs
- Variant.cs
- DataGridLinkButton.cs
- DbProviderServices.cs
- LayoutDump.cs
- PackageDigitalSignature.cs
- CellLabel.cs
- TreeNodeCollection.cs
- SqlDataSource.cs
- ObjectContextServiceProvider.cs
- PermissionListSet.cs
- WebPartDisplayMode.cs
- DesignerCategoryAttribute.cs
- URLMembershipCondition.cs