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
- ValidatorCollection.cs
- FederatedMessageSecurityOverHttp.cs
- FrameworkReadOnlyPropertyMetadata.cs
- MULTI_QI.cs
- TrackingWorkflowEventArgs.cs
- XhtmlBasicCommandAdapter.cs
- ColorPalette.cs
- CodeDelegateInvokeExpression.cs
- EmptyControlCollection.cs
- AnnotationResourceCollection.cs
- NativeMsmqMessage.cs
- shaperfactoryquerycachekey.cs
- Package.cs
- GridViewUpdateEventArgs.cs
- ServicePointManagerElement.cs
- TransformProviderWrapper.cs
- StylesEditorDialog.cs
- OperationAbortedException.cs
- SequentialActivityDesigner.cs
- BinaryNegotiation.cs
- MethodExecutor.cs
- RenderData.cs
- XmlSchemaValidationException.cs
- MemberDomainMap.cs
- AspNetHostingPermission.cs
- WorkItem.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- SQLResource.cs
- DescendantOverDescendantQuery.cs
- PageAdapter.cs
- SafeLibraryHandle.cs
- SafeNativeMethodsCLR.cs
- WebPartTransformerCollection.cs
- MailMessageEventArgs.cs
- AssemblyCollection.cs
- StructuralObject.cs
- DbDataReader.cs
- XmlSchemaResource.cs
- FamilyTypefaceCollection.cs
- ValidatorCollection.cs
- HttpStreams.cs
- Visual.cs
- FontStyleConverter.cs
- PreviewKeyDownEventArgs.cs
- PropertyDescriptorGridEntry.cs
- AnnotationResourceChangedEventArgs.cs
- QueryAccessibilityHelpEvent.cs
- TdsParserHelperClasses.cs
- ObjectSerializerFactory.cs
- SafeArrayTypeMismatchException.cs
- TextEffectResolver.cs
- PreviewControlDesigner.cs
- BitmapDownload.cs
- XdrBuilder.cs
- ThreadPool.cs
- OperationInfoBase.cs
- AttachedPropertyDescriptor.cs
- HtmlAnchor.cs
- ScrollChrome.cs
- WorkflowQueuingService.cs
- MemoryMappedFileSecurity.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- XmlSchemaObject.cs
- WebPartZoneCollection.cs
- ByteConverter.cs
- ISessionStateStore.cs
- XAMLParseException.cs
- WindowsListBox.cs
- RtfControls.cs
- RectangleGeometry.cs
- ProfileSettings.cs
- ThumbButtonInfoCollection.cs
- PerspectiveCamera.cs
- ColumnResult.cs
- DataPointer.cs
- RadioButtonAutomationPeer.cs
- DescendantOverDescendantQuery.cs
- HGlobalSafeHandle.cs
- BitmapEffectGroup.cs
- ContractMapping.cs
- ResourcesChangeInfo.cs
- SymmetricKeyWrap.cs
- SpeechSynthesizer.cs
- SettingsPropertyWrongTypeException.cs
- Triangle.cs
- RealizationDrawingContextWalker.cs
- PageEventArgs.cs
- EntityStoreSchemaGenerator.cs
- BuildProvidersCompiler.cs
- MD5.cs
- AutoSizeToolBoxItem.cs
- WebPartChrome.cs
- BitmapInitialize.cs
- ContextMenuService.cs
- DataGridViewCellStyleEditor.cs
- Stacktrace.cs
- TraceUtils.cs
- InputLanguageEventArgs.cs
- OuterGlowBitmapEffect.cs
- SqlRemoveConstantOrderBy.cs