Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / EventMappingSettings.cs / 2 / EventMappingSettings.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.Globalization; using System.IO; using System.Text; using System.ComponentModel; using System.Web.Hosting; using System.Web.Util; using System.Web.Configuration; using System.Web.Management; using System.Web.Compilation; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class EventMappingSettings : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propName = new ConfigurationProperty("name", typeof(string), null, null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); private static readonly ConfigurationProperty _propType = new ConfigurationProperty("type", typeof(string), String.Empty, ConfigurationPropertyOptions.IsRequired); private static readonly ConfigurationProperty _propStartEventCode = new ConfigurationProperty("startEventCode", typeof(int), 0, null, StdValidatorsAndConverters.PositiveIntegerValidator, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propEndEventCode = new ConfigurationProperty("endEventCode", typeof(int), int.MaxValue, null, StdValidatorsAndConverters.PositiveIntegerValidator, ConfigurationPropertyOptions.None); Type _type; // The real type internal Type RealType { get { Debug.Assert(_type != null, "_type != null"); return _type; } set { _type = value; } } static EventMappingSettings() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propName); _properties.Add(_propType); _properties.Add(_propStartEventCode); _properties.Add(_propEndEventCode); } internal EventMappingSettings() { } public EventMappingSettings(String name, String type, int startEventCode, int endEventCode) : this() { Name = name; Type = type; StartEventCode = startEventCode; EndEventCode = endEventCode; } public EventMappingSettings(String name, String type) : this() // Do not call the constructor which sets the event codes { // or the values will be persisted as it the user set them Name = name; Type = type; } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("name", IsRequired = true, IsKey = true, DefaultValue = "")] public String Name { get { return (string)base[_propName]; } set { base[_propName] = value; } } [ConfigurationProperty("type", IsRequired = true, DefaultValue = "")] public String Type { get { return (string)base[_propType]; } set { base[_propType] = value; } } [ConfigurationProperty("startEventCode", DefaultValue = 0)] [IntegerValidator(MinValue = 0)] public int StartEventCode { get { return (int)base[_propStartEventCode]; } set { base[_propStartEventCode] = value; } } [ConfigurationProperty("endEventCode", DefaultValue = int.MaxValue)] [IntegerValidator(MinValue = 0)] public int EndEventCode { get { return (int)base[_propEndEventCode]; } set { base[_propEndEventCode] = value; } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NameValueConfigurationCollection.cs
- TextFragmentEngine.cs
- sqlinternaltransaction.cs
- MonthCalendar.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- DataGridViewLayoutData.cs
- SHA384Managed.cs
- Int16Converter.cs
- Point3DAnimationUsingKeyFrames.cs
- ViewStateException.cs
- SizeLimitedCache.cs
- DataObjectEventArgs.cs
- DataGridRowEventArgs.cs
- VectorCollectionConverter.cs
- TemplateBindingExpression.cs
- ProfileInfo.cs
- RecommendedAsConfigurableAttribute.cs
- mongolianshape.cs
- AppendHelper.cs
- CalendarSelectionChangedEventArgs.cs
- EntityTemplateFactory.cs
- _NtlmClient.cs
- CodeStatement.cs
- TraceProvider.cs
- Symbol.cs
- TextFormatter.cs
- COAUTHIDENTITY.cs
- DependencyPropertyValueSerializer.cs
- RoleService.cs
- GridEntryCollection.cs
- BackgroundWorker.cs
- BitmapSource.cs
- Sorting.cs
- SlipBehavior.cs
- _ConnectionGroup.cs
- ApplicationDirectory.cs
- SafeSystemMetrics.cs
- StringAnimationBase.cs
- DictionarySectionHandler.cs
- CompilerLocalReference.cs
- HandleRef.cs
- HttpVersion.cs
- CodeGotoStatement.cs
- CompositeDataBoundControl.cs
- CodeTypeReferenceCollection.cs
- MultiBinding.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- RowType.cs
- FillRuleValidation.cs
- StreamGeometry.cs
- OrderByBuilder.cs
- WebPartConnectVerb.cs
- BindingNavigator.cs
- TreeNodeStyle.cs
- GenericTextProperties.cs
- SimpleWorkerRequest.cs
- SoapCodeExporter.cs
- WebPartConnectionsConnectVerb.cs
- ContextTokenTypeConverter.cs
- TypeSemantics.cs
- HtmlElementCollection.cs
- WasAdminWrapper.cs
- ArgumentOutOfRangeException.cs
- CompletedAsyncResult.cs
- RightNameExpirationInfoPair.cs
- TreeChangeInfo.cs
- OdbcDataReader.cs
- BeginStoryboard.cs
- HostSecurityManager.cs
- ProtectedProviderSettings.cs
- GenericTextProperties.cs
- DefaultParameterValueAttribute.cs
- ResponseBodyWriter.cs
- Win32PrintDialog.cs
- XPathBuilder.cs
- GlyphInfoList.cs
- SiteMapPath.cs
- UnaryNode.cs
- XPathSelectionIterator.cs
- NativeMethods.cs
- AccessibleObject.cs
- Compiler.cs
- FastEncoder.cs
- DataGridViewAutoSizeModeEventArgs.cs
- PipelineModuleStepContainer.cs
- DaylightTime.cs
- hresults.cs
- FrameworkReadOnlyPropertyMetadata.cs
- WebPartMovingEventArgs.cs
- formatter.cs
- ConfigurationManagerHelper.cs
- InheritanceContextHelper.cs
- ProfileInfo.cs
- ClipboardProcessor.cs
- BamlLocalizationDictionary.cs
- IntranetCredentialPolicy.cs
- FilterElement.cs
- XmlSchemaParticle.cs
- ToggleProviderWrapper.cs
- HashMembershipCondition.cs