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
- Popup.cs
- ParallelLoopState.cs
- UidManager.cs
- ActiveXHost.cs
- RouteValueDictionary.cs
- CodeTypeParameterCollection.cs
- InternalConfigRoot.cs
- EffectiveValueEntry.cs
- ExtendedProtectionPolicy.cs
- WinFormsSecurity.cs
- InputQueue.cs
- ValidationException.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- PrinterResolution.cs
- FontCacheLogic.cs
- CompilerError.cs
- DefaultTextStore.cs
- ObjectConverter.cs
- SqlCharStream.cs
- LineProperties.cs
- LogEntry.cs
- RoutedEventArgs.cs
- AdRotator.cs
- IUnknownConstantAttribute.cs
- DynamicContractTypeBuilder.cs
- KeyPressEvent.cs
- CharEntityEncoderFallback.cs
- XMLUtil.cs
- IRCollection.cs
- DeviceContext.cs
- FrameworkElement.cs
- GradientStop.cs
- DataGridViewMethods.cs
- RadioButton.cs
- METAHEADER.cs
- NGCSerializationManager.cs
- SqlDependencyUtils.cs
- XamlRtfConverter.cs
- AssociationTypeEmitter.cs
- ValidationEventArgs.cs
- SuppressMessageAttribute.cs
- ActivityPreviewDesigner.cs
- XamlSerializer.cs
- SqlDeflator.cs
- xmlsaver.cs
- StagingAreaInputItem.cs
- SiteMapNodeItem.cs
- FormatConvertedBitmap.cs
- ObjectAnimationBase.cs
- Formatter.cs
- ColorConvertedBitmap.cs
- SetterBase.cs
- ThumbButtonInfo.cs
- WebPartConnectionsConnectVerb.cs
- HtmlTernaryTree.cs
- RadioButton.cs
- assemblycache.cs
- BookmarkOptionsHelper.cs
- SiteMapNode.cs
- ScaleTransform.cs
- PackWebRequest.cs
- NetDataContractSerializer.cs
- CodeAttributeDeclarationCollection.cs
- DataControlLinkButton.cs
- TypeBuilder.cs
- Expr.cs
- SessionPageStateSection.cs
- uribuilder.cs
- Inline.cs
- SafeFileMapViewHandle.cs
- CanonicalFontFamilyReference.cs
- ServiceOperationWrapper.cs
- DocumentPage.cs
- ContextActivityUtils.cs
- DataGridViewCellCollection.cs
- ApplicationBuildProvider.cs
- TTSEngineTypes.cs
- ClipboardProcessor.cs
- StandardCommandToolStripMenuItem.cs
- FixedTextBuilder.cs
- FilteredReadOnlyMetadataCollection.cs
- x509utils.cs
- StretchValidation.cs
- Stack.cs
- WebRequest.cs
- UnmanagedMemoryAccessor.cs
- Parameter.cs
- ListChangedEventArgs.cs
- DocumentSequenceHighlightLayer.cs
- DockPattern.cs
- OrthographicCamera.cs
- DurableMessageDispatchInspector.cs
- CultureTableRecord.cs
- SqlNodeAnnotation.cs
- Int64.cs
- AppDomainFactory.cs
- ProjectionRewriter.cs
- PropertyFilterAttribute.cs
- DispatcherOperation.cs
- FrameDimension.cs