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
- WebServiceFault.cs
- FileChangesMonitor.cs
- DateRangeEvent.cs
- TemplateContentLoader.cs
- TransformedBitmap.cs
- UpDownEvent.cs
- OpenTypeMethods.cs
- ConfigurationSectionGroupCollection.cs
- EntityParameterCollection.cs
- ReadWriteSpinLock.cs
- MissingMethodException.cs
- TextCharacters.cs
- ToggleProviderWrapper.cs
- AmbientValueAttribute.cs
- ListViewAutomationPeer.cs
- CommentEmitter.cs
- CodeTypeParameter.cs
- AutomationPeer.cs
- SettingsAttributes.cs
- ParenExpr.cs
- OdbcConnectionFactory.cs
- GPPOINTF.cs
- RawStylusSystemGestureInputReport.cs
- ToolStripRenderer.cs
- NonDualMessageSecurityOverHttp.cs
- FindSimilarActivitiesVerb.cs
- Missing.cs
- cookieexception.cs
- BufferedOutputAsyncStream.cs
- X509PeerCertificateElement.cs
- StrokeNodeData.cs
- ExpressionEditorSheet.cs
- ServiceManager.cs
- TreeNodeBinding.cs
- SqlCrossApplyToCrossJoin.cs
- XmlWriterTraceListener.cs
- StreamResourceInfo.cs
- TemplateXamlParser.cs
- TypedElement.cs
- COM2Enum.cs
- StrokeSerializer.cs
- DataGridItemCollection.cs
- PolyQuadraticBezierSegment.cs
- WebRequestModuleElementCollection.cs
- SystemColorTracker.cs
- ContextCorrelationInitializer.cs
- FlowLayout.cs
- BuildResult.cs
- X509ChainPolicy.cs
- DefaultValueAttribute.cs
- CheckBoxAutomationPeer.cs
- ConfigurationSectionGroup.cs
- MarkupCompilePass1.cs
- ExpressionNormalizer.cs
- NavigateEvent.cs
- PieceDirectory.cs
- MatrixTransform.cs
- AuthenticationException.cs
- RectAnimationClockResource.cs
- ProfileManager.cs
- ClientScriptItem.cs
- WCFBuildProvider.cs
- VerificationException.cs
- FloaterBaseParaClient.cs
- UriWriter.cs
- UICuesEvent.cs
- DocumentSignatureManager.cs
- ListViewInsertedEventArgs.cs
- TCEAdapterGenerator.cs
- Size3DValueSerializer.cs
- DrawingDrawingContext.cs
- UniqueCodeIdentifierScope.cs
- Propagator.cs
- TextProperties.cs
- RoleManagerModule.cs
- DataColumnPropertyDescriptor.cs
- X509CertificateCollection.cs
- RegistrationServices.cs
- SynchronizationFilter.cs
- HttpApplicationFactory.cs
- TypeDescriptionProviderAttribute.cs
- CompilerGlobalScopeAttribute.cs
- RSACryptoServiceProvider.cs
- ToolStripDropDownMenu.cs
- TemplateBuilder.cs
- SqlClientFactory.cs
- DBCSCodePageEncoding.cs
- StaticFileHandler.cs
- MetadataImporter.cs
- Model3DGroup.cs
- Activity.cs
- ValidateNames.cs
- CellQuery.cs
- ImageClickEventArgs.cs
- TransactionChannel.cs
- ValueTypeFieldReference.cs
- ConditionalAttribute.cs
- BaseDataBoundControl.cs
- Iis7Helper.cs
- DateTimePicker.cs