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
- XAMLParseException.cs
- DataGridViewColumnCollection.cs
- GridViewCancelEditEventArgs.cs
- HandlerBase.cs
- EntityObject.cs
- CompletedAsyncResult.cs
- ColorIndependentAnimationStorage.cs
- Configuration.cs
- FileDialogCustomPlaces.cs
- CheckBox.cs
- DataListItem.cs
- ExplicitDiscriminatorMap.cs
- RenderDataDrawingContext.cs
- NativeRecognizer.cs
- ImmutableObjectAttribute.cs
- TransportSecurityHelpers.cs
- LayoutUtils.cs
- LoadedOrUnloadedOperation.cs
- RangeValueProviderWrapper.cs
- SQLMoneyStorage.cs
- DrawingBrush.cs
- hwndwrapper.cs
- BoolLiteral.cs
- TokenBasedSet.cs
- DatePickerDateValidationErrorEventArgs.cs
- SerialPort.cs
- OrderingQueryOperator.cs
- DefaultMergeHelper.cs
- QuotedPrintableStream.cs
- UnorderedHashRepartitionStream.cs
- SmtpTransport.cs
- TypeResolvingOptions.cs
- ProtocolElementCollection.cs
- XmlWellformedWriter.cs
- StateChangeEvent.cs
- MessageSmuggler.cs
- MergablePropertyAttribute.cs
- CollectionsUtil.cs
- SafeNativeMethods.cs
- BordersPage.cs
- Popup.cs
- WindowShowOrOpenTracker.cs
- RenderData.cs
- Bold.cs
- TargetConverter.cs
- RequestBringIntoViewEventArgs.cs
- PropertyAccessVisitor.cs
- DefaultMemberAttribute.cs
- CollectionChangedEventManager.cs
- IdleTimeoutMonitor.cs
- HttpPostedFile.cs
- EntityClassGenerator.cs
- DataGridCaption.cs
- EntityDataSourceValidationException.cs
- NotifyInputEventArgs.cs
- SizeAnimation.cs
- ModelFunction.cs
- TrackingExtract.cs
- XmlIlTypeHelper.cs
- ToolstripProfessionalRenderer.cs
- BinaryNode.cs
- SqlIdentifier.cs
- Evaluator.cs
- InkCanvas.cs
- QueryLifecycle.cs
- BaseAutoFormat.cs
- dsa.cs
- EtwTrace.cs
- UIPermission.cs
- MetadataCache.cs
- XmlSchemaAll.cs
- XmlAttributeAttribute.cs
- XmlSchemaSearchPattern.cs
- RouteItem.cs
- IOThreadScheduler.cs
- SyntaxCheck.cs
- InputLangChangeEvent.cs
- SchemaLookupTable.cs
- SqlDataSourceCustomCommandEditor.cs
- HtmlEmptyTagControlBuilder.cs
- CssClassPropertyAttribute.cs
- ThemeDirectoryCompiler.cs
- SchemaTypeEmitter.cs
- ClientSession.cs
- HttpRequest.cs
- VirtualPathProvider.cs
- AssemblyName.cs
- CompositeScriptReference.cs
- BaseCollection.cs
- WebResponse.cs
- TabControlEvent.cs
- CanonicalFontFamilyReference.cs
- BindingSource.cs
- ColumnMapTranslator.cs
- EntitySetDataBindingList.cs
- AssemblySettingAttributes.cs
- MediaTimeline.cs
- TokenizerHelper.cs
- AuthenticationModuleElement.cs
- ProfileEventArgs.cs