Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // 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
- TraceContextEventArgs.cs
- DataErrorValidationRule.cs
- ActivityScheduledRecord.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- MainMenu.cs
- ManagedWndProcTracker.cs
- ActivitySurrogate.cs
- TextInfo.cs
- WebPartZoneCollection.cs
- Bezier.cs
- TemplateXamlParser.cs
- WindowsFormsHelpers.cs
- WebConfigurationHostFileChange.cs
- SmtpFailedRecipientException.cs
- LateBoundBitmapDecoder.cs
- PropertyReferenceSerializer.cs
- TextTreeTextBlock.cs
- SafeCryptoHandles.cs
- ComplexBindingPropertiesAttribute.cs
- SqlMethodAttribute.cs
- QilScopedVisitor.cs
- MatrixCamera.cs
- DefaultValueTypeConverter.cs
- StyleCollectionEditor.cs
- FontDriver.cs
- HtmlInputButton.cs
- StatusBarPanelClickEvent.cs
- NativeMethods.cs
- WSFederationHttpSecurity.cs
- SqlCharStream.cs
- WebZoneDesigner.cs
- DescriptionAttribute.cs
- ServiceBusyException.cs
- BoundPropertyEntry.cs
- EntityCollection.cs
- Int64.cs
- StringComparer.cs
- HandlerBase.cs
- PersonalizationAdministration.cs
- Padding.cs
- ThemeDirectoryCompiler.cs
- HtmlAnchor.cs
- StrokeNodeOperations2.cs
- StylusShape.cs
- HttpFileCollectionBase.cs
- SqlTriggerAttribute.cs
- BuildProvidersCompiler.cs
- DataTableMapping.cs
- XmlWrappingWriter.cs
- QueueProcessor.cs
- DataGridViewLinkCell.cs
- AgileSafeNativeMemoryHandle.cs
- InfoCardTraceRecord.cs
- QilInvoke.cs
- DesignTimeTemplateParser.cs
- DoubleStorage.cs
- SystemTcpConnection.cs
- SmtpReplyReaderFactory.cs
- SqlDependencyUtils.cs
- ResetableIterator.cs
- StringStorage.cs
- ViewPort3D.cs
- QuaternionAnimation.cs
- CodeTryCatchFinallyStatement.cs
- HttpModuleAction.cs
- HyperlinkAutomationPeer.cs
- TextServicesProperty.cs
- SqlInfoMessageEvent.cs
- ISFClipboardData.cs
- SQLGuid.cs
- CalloutQueueItem.cs
- ClientTargetSection.cs
- TrackingServices.cs
- COM2EnumConverter.cs
- OleStrCAMarshaler.cs
- UIElementIsland.cs
- SimpleWebHandlerParser.cs
- MeasurementDCInfo.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- SByte.cs
- DataGridViewHeaderCell.cs
- RealProxy.cs
- XmlTextReaderImpl.cs
- SizeF.cs
- TextElementCollectionHelper.cs
- SharedStatics.cs
- Int64KeyFrameCollection.cs
- TemplateField.cs
- Accessors.cs
- CacheMode.cs
- UnsafeNativeMethodsTablet.cs
- ChannelServices.cs
- HttpProfileBase.cs
- SoapServerMessage.cs
- InstanceOwnerQueryResult.cs
- RadioButtonDesigner.cs
- OciEnlistContext.cs
- InkCanvasFeedbackAdorner.cs
- PerformanceCounterManager.cs
- DiagnosticTrace.cs