Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Configuration / TagMapInfo.cs / 1 / 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
- MatrixKeyFrameCollection.cs
- Size.cs
- xmlformatgeneratorstatics.cs
- ResourceType.cs
- WorkflowServiceAttributesTypeConverter.cs
- UriTemplateVariableQueryValue.cs
- ItemDragEvent.cs
- EdmMember.cs
- MessageQueuePermissionEntry.cs
- QuadraticBezierSegment.cs
- DesignerLoader.cs
- DataGridPageChangedEventArgs.cs
- Line.cs
- EdmMember.cs
- ExecutedRoutedEventArgs.cs
- Padding.cs
- BooleanConverter.cs
- ModulesEntry.cs
- HtmlContainerControl.cs
- VariableAction.cs
- SQLCharsStorage.cs
- ImpersonationContext.cs
- ToolBarDesigner.cs
- FuncTypeConverter.cs
- TypeProvider.cs
- JpegBitmapEncoder.cs
- TabControlDesigner.cs
- DurableInstanceContextProvider.cs
- PtsHost.cs
- CancelEventArgs.cs
- DictionaryEntry.cs
- DataSetSchema.cs
- RadialGradientBrush.cs
- ListCollectionView.cs
- TypeForwardedFromAttribute.cs
- ReadOnlyHierarchicalDataSource.cs
- XpsPartBase.cs
- AppearanceEditorPart.cs
- ImpersonationContext.cs
- CancelEventArgs.cs
- FixedSOMImage.cs
- CDSCollectionETWBCLProvider.cs
- OlePropertyStructs.cs
- StatusBarPanel.cs
- InputMethodStateTypeInfo.cs
- RMPublishingDialog.cs
- ParsedAttributeCollection.cs
- FieldMetadata.cs
- ListBoxDesigner.cs
- WS2007FederationHttpBinding.cs
- ListenDesigner.cs
- DataGridViewSelectedRowCollection.cs
- IsolatedStorageException.cs
- StateDesignerConnector.cs
- Set.cs
- DataStreams.cs
- EpmTargetPathSegment.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- GridViewRow.cs
- MessageFormatterConverter.cs
- DiscoveryOperationContextExtension.cs
- CSharpCodeProvider.cs
- RegisteredArrayDeclaration.cs
- Cursors.cs
- DocumentViewerBase.cs
- HTTPNotFoundHandler.cs
- ToolStripItemBehavior.cs
- XMLSyntaxException.cs
- BinaryUtilClasses.cs
- AutoCompleteStringCollection.cs
- TargetParameterCountException.cs
- EvidenceBase.cs
- hresults.cs
- XpsFilter.cs
- XslTransformFileEditor.cs
- FocusChangedEventArgs.cs
- CallbackHandler.cs
- IntSecurity.cs
- UserControlCodeDomTreeGenerator.cs
- FlowDocumentScrollViewer.cs
- CodeTypeDeclarationCollection.cs
- DataShape.cs
- CreateUserWizardAutoFormat.cs
- EmbeddedMailObject.cs
- StylusPlugin.cs
- ResourceDisplayNameAttribute.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ScrollProperties.cs
- ConnectionStringsExpressionBuilder.cs
- AssemblyBuilder.cs
- ZipIORawDataFileBlock.cs
- Signature.cs
- QueryableFilterUserControl.cs
- CodeAccessSecurityEngine.cs
- UniformGrid.cs
- SystemUnicastIPAddressInformation.cs
- XmlSchemaParticle.cs
- WorkflowInlining.cs
- InvalidDataException.cs
- ModelUIElement3D.cs