Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Configuration / HealthMonitoringSection.cs / 1 / HealthMonitoringSection.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 HealthMonitoringSection : ConfigurationSection {
const int MAX_HEARTBEAT_VALUE = Int32.MaxValue / 1000; // in sec; this value will be converted to ms and passed to Timer ctor, which takes a ms param
const bool DEFAULT_HEALTH_MONITORING_ENABLED = true;
const int DEFAULT_HEARTBEATINTERVAL = 0; // This was Zero in Machine.config and 60 in here
private static ConfigurationPropertyCollection _properties;
private static readonly ConfigurationProperty _propHeartbeatInterval =
new ConfigurationProperty("heartbeatInterval",
typeof(TimeSpan),
TimeSpan.FromSeconds((long)DEFAULT_HEARTBEATINTERVAL),
StdValidatorsAndConverters.TimeSpanSecondsConverter,
new TimeSpanValidator(TimeSpan.Zero, TimeSpan.FromSeconds(MAX_HEARTBEAT_VALUE)),
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propEnabled =
new ConfigurationProperty("enabled",
typeof(bool),
DEFAULT_HEALTH_MONITORING_ENABLED,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propBufferModes =
new ConfigurationProperty("bufferModes",
typeof(BufferModesCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propProviders =
new ConfigurationProperty("providers",
typeof(ProviderSettingsCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propProfileSettingsCollection =
new ConfigurationProperty("profiles",
typeof(ProfileSettingsCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propRuleSettingsCollection =
new ConfigurationProperty("rules",
typeof(RuleSettingsCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propEventMappingSettingsCollection =
new ConfigurationProperty("eventMappings",
typeof(EventMappingSettingsCollection),
null,
ConfigurationPropertyOptions.None);
static HealthMonitoringSection() {
// Property initialization
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propHeartbeatInterval);
_properties.Add(_propEnabled);
_properties.Add(_propBufferModes);
_properties.Add(_propProviders);
_properties.Add(_propProfileSettingsCollection);
_properties.Add(_propRuleSettingsCollection);
_properties.Add(_propEventMappingSettingsCollection);
}
public HealthMonitoringSection() {
}
protected override ConfigurationPropertyCollection Properties {
get {
return _properties;
}
}
[ConfigurationProperty("heartbeatInterval", DefaultValue = "00:00:00" /* DEFAULT_HEARTBEATINTERVAL */)]
[TypeConverter(typeof(TimeSpanSecondsConverter))]
[TimeSpanValidator(MinValueString = "00:00:00", MaxValueString = "24.20:31:23")]
public TimeSpan HeartbeatInterval {
get {
return (TimeSpan)base[_propHeartbeatInterval];
}
set {
base[_propHeartbeatInterval] = value;
}
}
[ConfigurationProperty("enabled", DefaultValue = DEFAULT_HEALTH_MONITORING_ENABLED)]
public bool Enabled {
get {
return (bool)base[_propEnabled];
}
set {
base[_propEnabled] = value;
}
}
[ConfigurationProperty("bufferModes")]
public BufferModesCollection BufferModes {
get {
return (BufferModesCollection)base[_propBufferModes];
}
}
[ConfigurationProperty("providers")]
public ProviderSettingsCollection Providers {
get {
return (ProviderSettingsCollection)base[_propProviders];
}
}
[ConfigurationProperty("profiles")]
public ProfileSettingsCollection Profiles {
get {
return (ProfileSettingsCollection)base[_propProfileSettingsCollection];
}
}
[ConfigurationProperty("rules")]
public RuleSettingsCollection Rules {
get {
return (RuleSettingsCollection)base[_propRuleSettingsCollection];
}
}
[ConfigurationProperty("eventMappings")]
public EventMappingSettingsCollection EventMappings {
get {
return (EventMappingSettingsCollection)base[_propEventMappingSettingsCollection];
}
}
} // class HealthMonitoringSection
}
// 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.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 HealthMonitoringSection : ConfigurationSection {
const int MAX_HEARTBEAT_VALUE = Int32.MaxValue / 1000; // in sec; this value will be converted to ms and passed to Timer ctor, which takes a ms param
const bool DEFAULT_HEALTH_MONITORING_ENABLED = true;
const int DEFAULT_HEARTBEATINTERVAL = 0; // This was Zero in Machine.config and 60 in here
private static ConfigurationPropertyCollection _properties;
private static readonly ConfigurationProperty _propHeartbeatInterval =
new ConfigurationProperty("heartbeatInterval",
typeof(TimeSpan),
TimeSpan.FromSeconds((long)DEFAULT_HEARTBEATINTERVAL),
StdValidatorsAndConverters.TimeSpanSecondsConverter,
new TimeSpanValidator(TimeSpan.Zero, TimeSpan.FromSeconds(MAX_HEARTBEAT_VALUE)),
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propEnabled =
new ConfigurationProperty("enabled",
typeof(bool),
DEFAULT_HEALTH_MONITORING_ENABLED,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propBufferModes =
new ConfigurationProperty("bufferModes",
typeof(BufferModesCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propProviders =
new ConfigurationProperty("providers",
typeof(ProviderSettingsCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propProfileSettingsCollection =
new ConfigurationProperty("profiles",
typeof(ProfileSettingsCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propRuleSettingsCollection =
new ConfigurationProperty("rules",
typeof(RuleSettingsCollection),
null,
ConfigurationPropertyOptions.None);
private static readonly ConfigurationProperty _propEventMappingSettingsCollection =
new ConfigurationProperty("eventMappings",
typeof(EventMappingSettingsCollection),
null,
ConfigurationPropertyOptions.None);
static HealthMonitoringSection() {
// Property initialization
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propHeartbeatInterval);
_properties.Add(_propEnabled);
_properties.Add(_propBufferModes);
_properties.Add(_propProviders);
_properties.Add(_propProfileSettingsCollection);
_properties.Add(_propRuleSettingsCollection);
_properties.Add(_propEventMappingSettingsCollection);
}
public HealthMonitoringSection() {
}
protected override ConfigurationPropertyCollection Properties {
get {
return _properties;
}
}
[ConfigurationProperty("heartbeatInterval", DefaultValue = "00:00:00" /* DEFAULT_HEARTBEATINTERVAL */)]
[TypeConverter(typeof(TimeSpanSecondsConverter))]
[TimeSpanValidator(MinValueString = "00:00:00", MaxValueString = "24.20:31:23")]
public TimeSpan HeartbeatInterval {
get {
return (TimeSpan)base[_propHeartbeatInterval];
}
set {
base[_propHeartbeatInterval] = value;
}
}
[ConfigurationProperty("enabled", DefaultValue = DEFAULT_HEALTH_MONITORING_ENABLED)]
public bool Enabled {
get {
return (bool)base[_propEnabled];
}
set {
base[_propEnabled] = value;
}
}
[ConfigurationProperty("bufferModes")]
public BufferModesCollection BufferModes {
get {
return (BufferModesCollection)base[_propBufferModes];
}
}
[ConfigurationProperty("providers")]
public ProviderSettingsCollection Providers {
get {
return (ProviderSettingsCollection)base[_propProviders];
}
}
[ConfigurationProperty("profiles")]
public ProfileSettingsCollection Profiles {
get {
return (ProfileSettingsCollection)base[_propProfileSettingsCollection];
}
}
[ConfigurationProperty("rules")]
public RuleSettingsCollection Rules {
get {
return (RuleSettingsCollection)base[_propRuleSettingsCollection];
}
}
[ConfigurationProperty("eventMappings")]
public EventMappingSettingsCollection EventMappings {
get {
return (EventMappingSettingsCollection)base[_propEventMappingSettingsCollection];
}
}
} // class HealthMonitoringSection
}
// 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
- FlowDocumentReaderAutomationPeer.cs
- SafeArrayTypeMismatchException.cs
- HttpDebugHandler.cs
- MultiAsyncResult.cs
- ClientRuntimeConfig.cs
- XDRSchema.cs
- ComContractElementCollection.cs
- XmlImplementation.cs
- UnderstoodHeaders.cs
- NTAccount.cs
- FlowPosition.cs
- FileClassifier.cs
- WebServiceErrorEvent.cs
- XPathDocumentNavigator.cs
- SortQuery.cs
- IntSecurity.cs
- DragStartedEventArgs.cs
- SchemaImporterExtensionElementCollection.cs
- SqlCachedBuffer.cs
- ClientRolePrincipal.cs
- TraceSource.cs
- ExpressionEvaluator.cs
- ReadOnlyCollectionBase.cs
- Utils.cs
- MDIWindowDialog.cs
- PipelineModuleStepContainer.cs
- CodeNamespaceImportCollection.cs
- ComboBox.cs
- RectangleHotSpot.cs
- ListBoxItemWrapperAutomationPeer.cs
- NetworkCredential.cs
- ObjectDataSourceDisposingEventArgs.cs
- CompressEmulationStream.cs
- Duration.cs
- HtmlInputHidden.cs
- DataReaderContainer.cs
- FigureParagraph.cs
- WindowsTokenRoleProvider.cs
- ErrorsHelper.cs
- ReferenceEqualityComparer.cs
- COAUTHIDENTITY.cs
- RowToParametersTransformer.cs
- DataRowComparer.cs
- TemplateControlCodeDomTreeGenerator.cs
- PictureBox.cs
- Typography.cs
- MenuBase.cs
- DefaultSection.cs
- XhtmlBasicControlAdapter.cs
- HttpServerVarsCollection.cs
- SelectionProviderWrapper.cs
- ConfigurationSectionGroupCollection.cs
- SafeThreadHandle.cs
- SchemaConstraints.cs
- WebControlsSection.cs
- StructuredTypeEmitter.cs
- ProjectedSlot.cs
- InkSerializer.cs
- MediaEntryAttribute.cs
- TextParagraphView.cs
- OleDbTransaction.cs
- NameGenerator.cs
- XPathAncestorIterator.cs
- LocalizabilityAttribute.cs
- ErrorWrapper.cs
- MultiTrigger.cs
- DateTimeFormatInfoScanner.cs
- DocComment.cs
- PixelShader.cs
- Completion.cs
- HtmlPanelAdapter.cs
- Rights.cs
- ControlBindingsCollection.cs
- RadioButtonBaseAdapter.cs
- DataMemberConverter.cs
- _OverlappedAsyncResult.cs
- WebPartUserCapability.cs
- RijndaelManagedTransform.cs
- DockAndAnchorLayout.cs
- WindowsSpinner.cs
- DocumentPage.cs
- WebPartConnectionsEventArgs.cs
- LinqExpressionNormalizer.cs
- Dictionary.cs
- Native.cs
- HitTestWithGeometryDrawingContextWalker.cs
- TextEditorContextMenu.cs
- DataGridViewHitTestInfo.cs
- namescope.cs
- FullTextBreakpoint.cs
- TextServicesCompartment.cs
- XmlRawWriterWrapper.cs
- DataListItemCollection.cs
- DeflateEmulationStream.cs
- ImageCodecInfo.cs
- Resources.Designer.cs
- mediaeventargs.cs
- DSGeneratorProblem.cs
- GeneratedContractType.cs
- smtppermission.cs