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
- AtomicFile.cs
- WebScriptClientGenerator.cs
- EntityExpressionVisitor.cs
- KeyProperty.cs
- PictureBoxDesigner.cs
- XmlDataSourceDesigner.cs
- FormViewPagerRow.cs
- NetStream.cs
- MenuCommands.cs
- EventArgs.cs
- __Error.cs
- QuerySettings.cs
- FileVersionInfo.cs
- CapabilitiesUse.cs
- DBDataPermission.cs
- ValidationPropertyAttribute.cs
- SortAction.cs
- ArrayExtension.cs
- ToolStripGrip.cs
- UICuesEvent.cs
- PropertyGroupDescription.cs
- FormatControl.cs
- MsmqInputChannel.cs
- SqlCommandSet.cs
- ZipIOExtraFieldPaddingElement.cs
- HttpCapabilitiesSectionHandler.cs
- PointCollection.cs
- AuthenticationManager.cs
- SmtpReplyReaderFactory.cs
- Exception.cs
- SqlGatherConsumedAliases.cs
- SystemTcpStatistics.cs
- AttributeConverter.cs
- MapPathBasedVirtualPathProvider.cs
- KnownBoxes.cs
- ComplexObject.cs
- ToolZone.cs
- HttpModuleAction.cs
- CompiledRegexRunner.cs
- XmlUrlResolver.cs
- XmlLanguage.cs
- NetworkAddressChange.cs
- GridViewUpdateEventArgs.cs
- BamlRecords.cs
- XmlDocumentType.cs
- MexBindingElement.cs
- GridViewCancelEditEventArgs.cs
- CustomAttributeFormatException.cs
- HttpRawResponse.cs
- RegexReplacement.cs
- XmlUtf8RawTextWriter.cs
- ContextStaticAttribute.cs
- OutOfMemoryException.cs
- UserControlDesigner.cs
- FormViewPageEventArgs.cs
- Parser.cs
- RuleSettingsCollection.cs
- Properties.cs
- ElementAction.cs
- ProfessionalColorTable.cs
- AddInPipelineAttributes.cs
- TextBlockAutomationPeer.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ContextStaticAttribute.cs
- SelectionBorderGlyph.cs
- Application.cs
- XmlBinaryWriter.cs
- EventPrivateKey.cs
- UpdateExpressionVisitor.cs
- CategoryAttribute.cs
- RoleManagerSection.cs
- ModifierKeysConverter.cs
- CommandBinding.cs
- PreloadHost.cs
- EventProxy.cs
- SQLMembershipProvider.cs
- CompareValidator.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- SQLSingleStorage.cs
- Validator.cs
- SelectionProviderWrapper.cs
- MatrixTransform3D.cs
- WindowsToolbar.cs
- StringDictionaryEditor.cs
- PathGeometry.cs
- MenuItem.cs
- BitmapMetadataBlob.cs
- ToolStripGripRenderEventArgs.cs
- BypassElement.cs
- ValidationSummary.cs
- DataSpaceManager.cs
- ProfileInfo.cs
- PackagePartCollection.cs
- PointAnimation.cs
- XmlSchemaType.cs
- BaseTemplateBuildProvider.cs
- DataServiceSaveChangesEventArgs.cs
- ReaderOutput.cs
- XmlAttributes.cs
- ServiceProviders.cs