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
- GlyphRunDrawing.cs
- DataGridViewIntLinkedList.cs
- PopupRootAutomationPeer.cs
- DataViewSettingCollection.cs
- MsdtcWrapper.cs
- ReadOnlyPermissionSet.cs
- Domain.cs
- SyntaxCheck.cs
- Emitter.cs
- FormViewUpdateEventArgs.cs
- Transform3DGroup.cs
- SpellCheck.cs
- BasicHttpMessageSecurityElement.cs
- PEFileReader.cs
- MemberHolder.cs
- ListDataHelper.cs
- CodeArrayCreateExpression.cs
- MainMenu.cs
- DataGridToolTip.cs
- CustomErrorCollection.cs
- DecimalAnimation.cs
- FontFamilyIdentifier.cs
- Publisher.cs
- ObjectNotFoundException.cs
- OrderedParallelQuery.cs
- SoapFault.cs
- WmlCommandAdapter.cs
- InputMethodStateTypeInfo.cs
- ActivityDesignerHighlighter.cs
- DeclaredTypeElementCollection.cs
- TemplateControlParser.cs
- IndentedTextWriter.cs
- MenuItemStyleCollection.cs
- Clock.cs
- HotCommands.cs
- ClientBuildManagerCallback.cs
- NumberFormatInfo.cs
- ProfileSettings.cs
- WebPartTracker.cs
- FontStyle.cs
- XmlToDatasetMap.cs
- NativeMethods.cs
- SafeMarshalContext.cs
- HandledMouseEvent.cs
- RequestResponse.cs
- Evidence.cs
- Timeline.cs
- DataSourceCacheDurationConverter.cs
- XpsFilter.cs
- webbrowsersite.cs
- OAVariantLib.cs
- SqlDeflator.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- CodeStatementCollection.cs
- DataControlFieldCell.cs
- XPathNodeIterator.cs
- SynchronizationValidator.cs
- invalidudtexception.cs
- ServiceOperation.cs
- PerspectiveCamera.cs
- TemplateManager.cs
- ButtonField.cs
- PackagingUtilities.cs
- CompilationRelaxations.cs
- FormViewInsertEventArgs.cs
- AxHost.cs
- VisualTreeUtils.cs
- RegexMatchCollection.cs
- EdmFunction.cs
- DataGridViewComboBoxColumn.cs
- BevelBitmapEffect.cs
- ParserHooks.cs
- PointConverter.cs
- QilReference.cs
- ObsoleteAttribute.cs
- PropertyValueChangedEvent.cs
- PeerNearMe.cs
- StringWriter.cs
- StringToken.cs
- DSACryptoServiceProvider.cs
- ImagingCache.cs
- MultiBindingExpression.cs
- ProtocolsConfiguration.cs
- DispatchRuntime.cs
- ProcessModelInfo.cs
- PathFigureCollection.cs
- SqlDependency.cs
- DataRowView.cs
- EpmCustomContentWriterNodeData.cs
- MenuItemBindingCollection.cs
- UpnEndpointIdentityExtension.cs
- CultureMapper.cs
- StorageComplexTypeMapping.cs
- basevalidator.cs
- WSUtilitySpecificationVersion.cs
- AutomationPropertyInfo.cs
- PenContext.cs
- ExtenderProvidedPropertyAttribute.cs
- ReadOnlyCollection.cs
- SourceFileInfo.cs