Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / ConfigurationFileMap.cs / 1305376 / ConfigurationFileMap.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Specialized; using System.Security; using System.Security.Permissions; using System.IO; namespace System.Configuration { // // Holds the configuration file mapping for // machine.config. It is the base class for // ExeConfigurationFileMap and WebConfigurationFileMap. // public class ConfigurationFileMap : ICloneable { string _machineConfigFilename; bool _requirePathDiscovery; public ConfigurationFileMap() { _machineConfigFilename = ClientConfigurationHost.MachineConfigFilePath; _requirePathDiscovery = true; } public ConfigurationFileMap(string machineConfigFilename) { if (string.IsNullOrEmpty(machineConfigFilename)) throw new ArgumentNullException("machineConfigFilename"); if (!File.Exists(machineConfigFilename)) throw new ArgumentException(SR.GetString(SR.Machine_config_file_not_found, machineConfigFilename), "machineConfigFilename"); _machineConfigFilename = machineConfigFilename; } public virtual object Clone() { return new ConfigurationFileMap(_machineConfigFilename); } // // The name of machine.config. // public string MachineConfigFilename { get { // // Ensure that we use the same string to issue the demand that we use to // return to the caller. // string filename = _machineConfigFilename; if (_requirePathDiscovery) { new FileIOPermission(FileIOPermissionAccess.PathDiscovery, filename).Demand(); } return filename; } set { _requirePathDiscovery = false; _machineConfigFilename = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Specialized; using System.Security; using System.Security.Permissions; using System.IO; namespace System.Configuration { // // Holds the configuration file mapping for // machine.config. It is the base class for // ExeConfigurationFileMap and WebConfigurationFileMap. // public class ConfigurationFileMap : ICloneable { string _machineConfigFilename; bool _requirePathDiscovery; public ConfigurationFileMap() { _machineConfigFilename = ClientConfigurationHost.MachineConfigFilePath; _requirePathDiscovery = true; } public ConfigurationFileMap(string machineConfigFilename) { if (string.IsNullOrEmpty(machineConfigFilename)) throw new ArgumentNullException("machineConfigFilename"); if (!File.Exists(machineConfigFilename)) throw new ArgumentException(SR.GetString(SR.Machine_config_file_not_found, machineConfigFilename), "machineConfigFilename"); _machineConfigFilename = machineConfigFilename; } public virtual object Clone() { return new ConfigurationFileMap(_machineConfigFilename); } // // The name of machine.config. // public string MachineConfigFilename { get { // // Ensure that we use the same string to issue the demand that we use to // return to the caller. // string filename = _machineConfigFilename; if (_requirePathDiscovery) { new FileIOPermission(FileIOPermissionAccess.PathDiscovery, filename).Demand(); } return filename; } set { _requirePathDiscovery = false; _machineConfigFilename = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SolidColorBrush.cs
- UInt32.cs
- SourceLineInfo.cs
- BinaryNode.cs
- ErrorStyle.cs
- SocketException.cs
- InvokeBase.cs
- ResourceAttributes.cs
- DrawingImage.cs
- SamlAction.cs
- WsdlInspector.cs
- ScrollBar.cs
- StringComparer.cs
- WSHttpBindingBaseElement.cs
- AxParameterData.cs
- ListBindableAttribute.cs
- InkCanvasAutomationPeer.cs
- TypeUsage.cs
- StrokeCollectionDefaultValueFactory.cs
- DataObject.cs
- TypeSystem.cs
- TabletCollection.cs
- DataGridViewUtilities.cs
- DataGridrowEditEndingEventArgs.cs
- Int64AnimationUsingKeyFrames.cs
- DifferencingCollection.cs
- RootBuilder.cs
- PolicyLevel.cs
- Int16Storage.cs
- CommandConverter.cs
- MonthCalendar.cs
- complextypematerializer.cs
- DataGridViewColumnStateChangedEventArgs.cs
- CompilerScopeManager.cs
- DataGridViewTextBoxEditingControl.cs
- CommandLineParser.cs
- ResourceContainerWrapper.cs
- _UncName.cs
- SRGSCompiler.cs
- PublisherMembershipCondition.cs
- MsmqInputChannelBase.cs
- GridSplitterAutomationPeer.cs
- DateTime.cs
- CapabilitiesState.cs
- DataRelationPropertyDescriptor.cs
- DefaultDiscoveryServiceExtension.cs
- ColorBlend.cs
- Grant.cs
- StateBag.cs
- DocumentCollection.cs
- FileUpload.cs
- ListItem.cs
- StringUtil.cs
- ComponentGuaranteesAttribute.cs
- QueryStringParameter.cs
- ListViewItemMouseHoverEvent.cs
- SkipQueryOptionExpression.cs
- PreviewPageInfo.cs
- XmlSchemaInferenceException.cs
- basecomparevalidator.cs
- XmlDeclaration.cs
- ChtmlTextWriter.cs
- CacheDependency.cs
- SqlRowUpdatingEvent.cs
- ImageCollectionCodeDomSerializer.cs
- TabPageDesigner.cs
- SqlCacheDependencyDatabaseCollection.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- EventLogEntryCollection.cs
- OAVariantLib.cs
- ProgressPage.cs
- ToolStripButton.cs
- HashHelper.cs
- SoapReflectionImporter.cs
- UiaCoreTypesApi.cs
- NumericUpDownAcceleration.cs
- indexingfiltermarshaler.cs
- SystemWebSectionGroup.cs
- CompositionDesigner.cs
- SqlUtil.cs
- XmlDataFileEditor.cs
- BackStopAuthenticationModule.cs
- FormatException.cs
- XmlDocument.cs
- PageCodeDomTreeGenerator.cs
- ConfigXmlSignificantWhitespace.cs
- ServiceModelConfigurationElementCollection.cs
- CacheSection.cs
- RequestResponse.cs
- CreateDataSourceDialog.cs
- NativeObjectSecurity.cs
- CloudCollection.cs
- Predicate.cs
- IListConverters.cs
- SingleObjectCollection.cs
- TextDecorationCollection.cs
- CapabilitiesState.cs
- ToolStripPanelRow.cs
- QuerySetOp.cs
- ZipIOLocalFileBlock.cs