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
- PipelineModuleStepContainer.cs
- FontSizeConverter.cs
- Debug.cs
- NamespaceInfo.cs
- URL.cs
- DeploymentSection.cs
- ListViewAutomationPeer.cs
- TcpChannelHelper.cs
- XPathNodeHelper.cs
- TagNameToTypeMapper.cs
- HTMLTagNameToTypeMapper.cs
- WorkflowElementDialogWindow.xaml.cs
- DispatcherObject.cs
- WebBrowserNavigatingEventHandler.cs
- VirtualPathUtility.cs
- InvalidDataException.cs
- URLString.cs
- ControlFilterExpression.cs
- AutoGeneratedFieldProperties.cs
- SafeTokenHandle.cs
- SupportsEventValidationAttribute.cs
- PositiveTimeSpanValidatorAttribute.cs
- DynamicValidator.cs
- TracedNativeMethods.cs
- Image.cs
- SchemaTypeEmitter.cs
- SettingsPropertyNotFoundException.cs
- ConvertEvent.cs
- ExecutionEngineException.cs
- ExtenderControl.cs
- MachineKeyConverter.cs
- TextEditorParagraphs.cs
- TypeConverterHelper.cs
- SmtpReplyReader.cs
- BitmapEffectGeneralTransform.cs
- RangeBaseAutomationPeer.cs
- CompileLiteralTextParser.cs
- InvalidOleVariantTypeException.cs
- XPathAxisIterator.cs
- MissingMethodException.cs
- CultureTable.cs
- DiscoveryDocumentReference.cs
- HtmlTernaryTree.cs
- ObjectConverter.cs
- GPStream.cs
- ContentValidator.cs
- ConvertersCollection.cs
- LongPath.cs
- DataGridViewTopLeftHeaderCell.cs
- LambdaCompiler.Generated.cs
- XmlElementList.cs
- CompleteWizardStep.cs
- FormatterConverter.cs
- TextEffect.cs
- Convert.cs
- ModelItemKeyValuePair.cs
- GlobalizationAssembly.cs
- InstanceLockQueryResult.cs
- Assembly.cs
- SiteMapNodeItem.cs
- ManagedFilter.cs
- JapaneseCalendar.cs
- BamlBinaryReader.cs
- WorkflowInstanceRecord.cs
- System.Data_BID.cs
- versioninfo.cs
- MenuItemBinding.cs
- CacheModeConverter.cs
- PreApplicationStartMethodAttribute.cs
- PropertyTabChangedEvent.cs
- DataGridViewSortCompareEventArgs.cs
- StyleModeStack.cs
- KerberosTicketHashIdentifierClause.cs
- DESCryptoServiceProvider.cs
- ProfileBuildProvider.cs
- SortedDictionary.cs
- TreeSet.cs
- UnauthorizedWebPart.cs
- ConstructorArgumentAttribute.cs
- ComponentDispatcher.cs
- PriorityBinding.cs
- ScrollChangedEventArgs.cs
- TextTreeTextNode.cs
- ToolStrip.cs
- SafeNativeMethods.cs
- ApplyImportsAction.cs
- RoutedEventValueSerializer.cs
- WebPartConnectionsConnectVerb.cs
- TextEndOfSegment.cs
- BaseProcessor.cs
- XmlChildEnumerator.cs
- SizeFConverter.cs
- ConfigXmlComment.cs
- ColumnHeaderConverter.cs
- CodeCompileUnit.cs
- Vector3DAnimationUsingKeyFrames.cs
- XsdBuilder.cs
- BindingOperations.cs
- LayoutSettings.cs
- OleDbConnectionFactory.cs