Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / Configuration / MachineSettingsSection.cs / 1305376 / MachineSettingsSection.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.Transactions.Configuration
{
using System.Configuration;
using System.Collections.Generic;
using System.Globalization;
public sealed class MachineSettingsSection : ConfigurationSection
{
public MachineSettingsSection() : base()
{
}
// System.Transactions reads the Configuration information in a non destructive way.
static internal MachineSettingsSection GetSection()
{
MachineSettingsSection retval = (MachineSettingsSection)PrivilegedConfigurationManager.GetSection(ConfigurationStrings.MachineSettingsSectionPath);
if (retval == null)
{
throw new ConfigurationErrorsException(string.Format(CultureInfo.CurrentCulture,
SR.GetString(SR.ConfigurationSectionNotFound),
ConfigurationStrings.MachineSettingsSectionPath));
}
return retval;
}
// public properties
[ConfigurationProperty(ConfigurationStrings.MaxTimeout, DefaultValue=ConfigurationStrings.DefaultMaxTimeout)]
[TimeSpanValidator(MinValueString = ConfigurationStrings.TimeSpanZero, MaxValueString=TimeSpanValidatorAttribute.TimeSpanMaxValue)]
public TimeSpan MaxTimeout
{
// System.Transactions reads the Configuration information in a non destructive way.
get { return (TimeSpan)base[ConfigurationStrings.MaxTimeout];}
set
{
if (!ConfigurationStrings.IsValidTimeSpan(value))
{
throw new ArgumentOutOfRangeException("MaxTimeout", SR.GetString(SR.ConfigInvalidTimeSpanValue));
}
base[ConfigurationStrings.MaxTimeout] = value;
}
}
protected override ConfigurationPropertyCollection Properties
{
get
{
ConfigurationPropertyCollection retval = new ConfigurationPropertyCollection();
retval.Add(new ConfigurationProperty( ConfigurationStrings.MaxTimeout,
typeof(TimeSpan),
ConfigurationStrings.DefaultMaxTimeout,
null,
new TimeSpanValidator( TimeSpan.Zero, TimeSpan.MaxValue ),
ConfigurationPropertyOptions.None));
return retval;
}
}
}
}
// 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
- ClientBuildManager.cs
- EntityDataSourceEntitySetNameItem.cs
- SecurityTokenProvider.cs
- TransformerTypeCollection.cs
- SchemaImporterExtension.cs
- DataSvcMapFileSerializer.cs
- dbenumerator.cs
- DataGridViewImageColumn.cs
- PreviewPrintController.cs
- WebPartTransformerAttribute.cs
- MachineKeyConverter.cs
- SignedInfo.cs
- BuildDependencySet.cs
- BinaryExpressionHelper.cs
- SqlDataSourceQuery.cs
- TopClause.cs
- SmtpException.cs
- LayoutEvent.cs
- TextTreeFixupNode.cs
- FormatStringEditor.cs
- EnvironmentPermission.cs
- VectorAnimationUsingKeyFrames.cs
- CalendarDay.cs
- GeneralTransform2DTo3D.cs
- BehaviorEditorPart.cs
- WCFModelStrings.Designer.cs
- EditBehavior.cs
- SignedXml.cs
- PathTooLongException.cs
- PolicyVersionConverter.cs
- ProfileSettings.cs
- UpdatePanelTriggerCollection.cs
- DesignerAttribute.cs
- TogglePattern.cs
- GeneralTransform.cs
- ValueTypeFixupInfo.cs
- CompoundFileDeflateTransform.cs
- InkPresenterAutomationPeer.cs
- XmlSchemaNotation.cs
- CustomBinding.cs
- SingleTagSectionHandler.cs
- ImageDrawing.cs
- Image.cs
- ExpandSegment.cs
- Environment.cs
- InputMethod.cs
- AmbientProperties.cs
- LinqExpressionNormalizer.cs
- BasicKeyConstraint.cs
- PipelineModuleStepContainer.cs
- XamlStackWriter.cs
- Dictionary.cs
- XsltInput.cs
- EditorPartChrome.cs
- NumericExpr.cs
- UniqueConstraint.cs
- ToolStripItemEventArgs.cs
- Propagator.Evaluator.cs
- WebHttpBehavior.cs
- PersistChildrenAttribute.cs
- DataKey.cs
- DLinqTableProvider.cs
- ExecutionEngineException.cs
- TileModeValidation.cs
- CacheDict.cs
- ThreadNeutralSemaphore.cs
- TrackingServices.cs
- SqlConnectionString.cs
- XmlRootAttribute.cs
- RadialGradientBrush.cs
- WebUtility.cs
- MutexSecurity.cs
- RoleManagerModule.cs
- Journaling.cs
- DocumentViewer.cs
- EnumerationRangeValidationUtil.cs
- FixedSOMLineRanges.cs
- RemotingAttributes.cs
- DependencyPropertyKey.cs
- DataGridViewCellCancelEventArgs.cs
- VisualStyleElement.cs
- LazyTextWriterCreator.cs
- ThrowHelper.cs
- ConstraintCollection.cs
- FileDialog_Vista_Interop.cs
- XamlTemplateSerializer.cs
- PlatformCulture.cs
- ButtonAutomationPeer.cs
- ZipIOFileItemStream.cs
- ServiceOperationViewControl.cs
- shaper.cs
- PropertyItem.cs
- TextLineResult.cs
- HttpWriter.cs
- XmlReflectionImporter.cs
- XmlSignatureManifest.cs
- PowerStatus.cs
- PopOutPanel.cs
- EmptyCollection.cs
- TextDecoration.cs