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
- SmiXetterAccessMap.cs
- UseLicense.cs
- EncryptedHeaderXml.cs
- APCustomTypeDescriptor.cs
- BaseHashHelper.cs
- processwaithandle.cs
- SchemaRegistration.cs
- WebHttpDispatchOperationSelector.cs
- TextHidden.cs
- XmlWellformedWriter.cs
- EditorResources.cs
- TemplateXamlTreeBuilder.cs
- MulticastDelegate.cs
- ButtonFlatAdapter.cs
- base64Transforms.cs
- Underline.cs
- HitTestParameters.cs
- RequestCacheManager.cs
- PageEventArgs.cs
- RegistryExceptionHelper.cs
- FactoryId.cs
- TabItemAutomationPeer.cs
- Geometry3D.cs
- DelegateCompletionCallbackWrapper.cs
- DependencySource.cs
- LocalizableResourceBuilder.cs
- SqlDataRecord.cs
- AutomationPropertyInfo.cs
- ArgumentOutOfRangeException.cs
- TypeSystem.cs
- IdentityValidationException.cs
- SqlNode.cs
- CryptoHelper.cs
- StatusBarDesigner.cs
- XmlAttributeAttribute.cs
- TextServicesPropertyRanges.cs
- ExtensionSimplifierMarkupObject.cs
- ProgressiveCrcCalculatingStream.cs
- TokenizerHelper.cs
- _NativeSSPI.cs
- IdentifierCollection.cs
- EFColumnProvider.cs
- DataMemberAttribute.cs
- ConfigXmlSignificantWhitespace.cs
- PeerDuplexChannelListener.cs
- cache.cs
- AccessKeyManager.cs
- ConditionalAttribute.cs
- CommonRemoteMemoryBlock.cs
- ToolTip.cs
- PersonalizationProviderCollection.cs
- OrderedDictionaryStateHelper.cs
- SpeechAudioFormatInfo.cs
- PropertyPathWorker.cs
- DataGridView.cs
- AutomationPropertyInfo.cs
- TextDecorationCollection.cs
- SimpleWebHandlerParser.cs
- XmlParserContext.cs
- StatusBarAutomationPeer.cs
- RegistrationProxy.cs
- ProcessInfo.cs
- SQLRoleProvider.cs
- AsyncStreamReader.cs
- ErrorLog.cs
- PropertyMappingExceptionEventArgs.cs
- elementinformation.cs
- PagerSettings.cs
- AutomationPeer.cs
- DynamicValidatorEventArgs.cs
- ShaderEffect.cs
- DispatcherHookEventArgs.cs
- SettingsPropertyWrongTypeException.cs
- Hex.cs
- DbProviderFactories.cs
- SymbolMethod.cs
- AllMembershipCondition.cs
- TableLayoutSettings.cs
- TextPointer.cs
- FileSystemWatcher.cs
- HandledEventArgs.cs
- SqlServices.cs
- WebResourceAttribute.cs
- OneOfElement.cs
- FlowDocumentPaginator.cs
- XmlSchemaObjectTable.cs
- DoubleCollection.cs
- BufferedOutputStream.cs
- DefaultPrintController.cs
- DataGridState.cs
- FlowNode.cs
- RoutedEventConverter.cs
- ContextQuery.cs
- URLIdentityPermission.cs
- GcHandle.cs
- UniqueEventHelper.cs
- WebPartCloseVerb.cs
- SchemaManager.cs
- CustomTypeDescriptor.cs
- Scheduling.cs