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
- ExtendedProtectionPolicyElement.cs
- PolyLineSegment.cs
- SchemaSetCompiler.cs
- Int32CAMarshaler.cs
- Axis.cs
- GeneralTransform3D.cs
- ScriptControlDescriptor.cs
- MainMenu.cs
- RadioButton.cs
- DataGridViewCellStyleBuilderDialog.cs
- Roles.cs
- DotExpr.cs
- ServiceChannelFactory.cs
- AttributeCollection.cs
- CryptoApi.cs
- DbDeleteCommandTree.cs
- ResourceWriter.cs
- SessionStateItemCollection.cs
- UnsafeNativeMethods.cs
- cookie.cs
- BinaryParser.cs
- DesignTableCollection.cs
- XmlArrayAttribute.cs
- FormViewDeleteEventArgs.cs
- _NegotiateClient.cs
- QueryCacheEntry.cs
- GlyphRunDrawing.cs
- BoundPropertyEntry.cs
- util.cs
- Variable.cs
- ProgressBar.cs
- Hex.cs
- StructuralType.cs
- ThicknessAnimationUsingKeyFrames.cs
- StringSorter.cs
- ComponentRenameEvent.cs
- Matrix3DConverter.cs
- ButtonAutomationPeer.cs
- LinqDataSourceSelectEventArgs.cs
- Vector.cs
- VarRefManager.cs
- DataProtection.cs
- PropertyPathWorker.cs
- FileLoadException.cs
- PointAnimationBase.cs
- ObjectStateFormatter.cs
- documentsequencetextcontainer.cs
- XPathMultyIterator.cs
- SelectingProviderEventArgs.cs
- FloaterBaseParaClient.cs
- RegistrationServices.cs
- XmlDownloadManager.cs
- CommonXSendMessage.cs
- ManagedIStream.cs
- StandardOleMarshalObject.cs
- WizardPanel.cs
- ClientSettings.cs
- FactoryGenerator.cs
- X500Name.cs
- Policy.cs
- MenuItemBindingCollection.cs
- WindowsRichEdit.cs
- GB18030Encoding.cs
- NavigationPropertyEmitter.cs
- AutomationEventArgs.cs
- DebugControllerThread.cs
- GridViewRow.cs
- EdmToObjectNamespaceMap.cs
- BaseConfigurationRecord.cs
- IItemContainerGenerator.cs
- SecurityElement.cs
- GradientBrush.cs
- ListViewItem.cs
- WebPartDeleteVerb.cs
- DnsCache.cs
- ListControl.cs
- TreeNodeBindingDepthConverter.cs
- XmlBufferReader.cs
- ExecutionContext.cs
- TextSelectionHighlightLayer.cs
- XmlTextReaderImpl.cs
- TitleStyle.cs
- BufferedWebEventProvider.cs
- MenuItem.cs
- Predicate.cs
- Exceptions.cs
- TryLoadRunnableWorkflowCommand.cs
- X509ChainElement.cs
- X509Certificate2Collection.cs
- ProfileSettingsCollection.cs
- Nullable.cs
- CodeIndexerExpression.cs
- URLIdentityPermission.cs
- TextFormatter.cs
- AsmxEndpointPickerExtension.cs
- BindingMemberInfo.cs
- OutputCache.cs
- GAC.cs
- InfoCardTraceRecord.cs
- MaskedTextBoxTextEditor.cs