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
- unitconverter.cs
- RijndaelManaged.cs
- QueryStringHandler.cs
- XPathSelfQuery.cs
- ArrayConverter.cs
- FormViewPagerRow.cs
- XmlEncoding.cs
- GenerateHelper.cs
- BamlReader.cs
- EventItfInfo.cs
- OdbcConnection.cs
- ComponentResourceKeyConverter.cs
- ExceptionCollection.cs
- ElementHost.cs
- TableParaClient.cs
- HttpContext.cs
- XmlDeclaration.cs
- OdbcConnection.cs
- KoreanLunisolarCalendar.cs
- DataServiceConfiguration.cs
- BufferedGraphicsContext.cs
- InternalCache.cs
- mediaclock.cs
- ExpressionBuilder.cs
- CodeExpressionCollection.cs
- LogicalExpressionTypeConverter.cs
- PersonalizablePropertyEntry.cs
- TypefaceCollection.cs
- BindingSourceDesigner.cs
- SymmetricKey.cs
- ResolveCompletedEventArgs.cs
- OleDbError.cs
- MemoryStream.cs
- CoreSwitches.cs
- DefinitionUpdate.cs
- TableColumn.cs
- SqlClientWrapperSmiStreamChars.cs
- ToolStripProgressBar.cs
- MutexSecurity.cs
- Compiler.cs
- QilInvoke.cs
- BaseResourcesBuildProvider.cs
- ReflectionUtil.cs
- EditorPart.cs
- LinqDataSourceEditData.cs
- FormatVersion.cs
- WorkflowExecutor.cs
- SearchForVirtualItemEventArgs.cs
- AuthorizationSection.cs
- ValidationErrorEventArgs.cs
- HttpListenerPrefixCollection.cs
- CodeMemberEvent.cs
- XslAstAnalyzer.cs
- StylusTouchDevice.cs
- WindowsListViewScroll.cs
- ToolboxItem.cs
- NamedPermissionSet.cs
- WMIGenerator.cs
- IDQuery.cs
- CommandBinding.cs
- GridViewRow.cs
- HostingEnvironment.cs
- _HTTPDateParse.cs
- FilterEventArgs.cs
- PasswordTextContainer.cs
- _LocalDataStoreMgr.cs
- XmlCharCheckingWriter.cs
- CompleteWizardStep.cs
- XmlTypeAttribute.cs
- DuplicateWaitObjectException.cs
- XsdCachingReader.cs
- ILGen.cs
- Exceptions.cs
- StateDesignerConnector.cs
- MembershipSection.cs
- WeakHashtable.cs
- MobileSysDescriptionAttribute.cs
- FunctionNode.cs
- ParagraphResult.cs
- DataRecord.cs
- RoleManagerSection.cs
- ResourceReader.cs
- SubMenuStyle.cs
- ReachSerializer.cs
- ByeOperationAsyncResult.cs
- CachedRequestParams.cs
- SizeFConverter.cs
- UpdateTracker.cs
- FacetDescription.cs
- EventProviderWriter.cs
- NamespaceDecl.cs
- SystemIcons.cs
- OleTxTransaction.cs
- ForeignKeyConstraint.cs
- ListViewItem.cs
- ProxyGenerationError.cs
- OleDbDataAdapter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- MetadataArtifactLoaderFile.cs
- ConfigurationSectionGroup.cs