Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / PropertySourceInfo.cs / 1305376 / PropertySourceInfo.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Configuration.Internal; using System.Collections; using System.Collections.Specialized; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; namespace System.Configuration { internal class PropertySourceInfo { private string _fileName; private int _lineNumber; internal PropertySourceInfo(XmlReader reader) { _fileName = GetFilename(reader); _lineNumber = GetLineNumber(reader); } internal string FileName { get { // // Ensure we return the same string to the caller as the one on which we issued the demand. // string filename = _fileName; try { new FileIOPermission(FileIOPermissionAccess.PathDiscovery, filename).Demand(); } catch (SecurityException) { // don't expose the path to this user but show the filename filename = Path.GetFileName(_fileName); if (filename == null) { filename = String.Empty; } } return filename; } } internal int LineNumber { get { return _lineNumber; } } private string GetFilename(XmlReader reader) { IConfigErrorInfo err = reader as IConfigErrorInfo; if (err != null) { return (string)err.Filename; } return ""; } private int GetLineNumber(XmlReader reader) { IConfigErrorInfo err = reader as IConfigErrorInfo; if (err != null) { return (int)err.LineNumber; } return 0; } } } // 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
- TextTreeInsertUndoUnit.cs
- MutexSecurity.cs
- EventWaitHandleSecurity.cs
- XPathNavigator.cs
- IndicFontClient.cs
- CompiledIdentityConstraint.cs
- TableSectionStyle.cs
- NotImplementedException.cs
- WorkflowQueuingService.cs
- SearchForVirtualItemEventArgs.cs
- InvokeHandlers.cs
- Helper.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- SocketAddress.cs
- MemberDescriptor.cs
- UniqueIdentifierService.cs
- CollectionEditor.cs
- GetCardDetailsRequest.cs
- WindowsListBox.cs
- RelatedView.cs
- CacheOutputQuery.cs
- AsnEncodedData.cs
- BamlResourceSerializer.cs
- ComponentEditorForm.cs
- HitTestWithPointDrawingContextWalker.cs
- RequestUriProcessor.cs
- DbXmlEnabledProviderManifest.cs
- DbUpdateCommandTree.cs
- GeometryDrawing.cs
- PlaceHolder.cs
- EntityModelSchemaGenerator.cs
- StrongNameUtility.cs
- CreateUserErrorEventArgs.cs
- BufferAllocator.cs
- SrgsRulesCollection.cs
- Model3D.cs
- ProxyManager.cs
- BitmapPalette.cs
- CommandBindingCollection.cs
- WebPartMenuStyle.cs
- XmlAttribute.cs
- ZipPackage.cs
- HashAlgorithm.cs
- CommandCollectionEditor.cs
- ComponentResourceKey.cs
- XmlNodeChangedEventArgs.cs
- MetadataUtil.cs
- XmlTextEncoder.cs
- DurableOperationAttribute.cs
- TabOrder.cs
- XmlEncodedRawTextWriter.cs
- CodeObject.cs
- AsyncOperationManager.cs
- RelatedImageListAttribute.cs
- ExtensibleClassFactory.cs
- GradientBrush.cs
- HostingPreferredMapPath.cs
- DeclarativeCatalogPartDesigner.cs
- UniqueConstraint.cs
- ConnectionOrientedTransportManager.cs
- HostedNamedPipeTransportManager.cs
- WebHeaderCollection.cs
- HttpProfileBase.cs
- InteropAutomationProvider.cs
- SessionStateContainer.cs
- SafeProcessHandle.cs
- WebPartUserCapability.cs
- Rijndael.cs
- DetailsViewPageEventArgs.cs
- StructuredTypeInfo.cs
- KeyGestureValueSerializer.cs
- WorkflowStateRollbackService.cs
- TextServicesCompartmentEventSink.cs
- ButtonColumn.cs
- XmlSchemaComplexContentRestriction.cs
- SystemIPInterfaceProperties.cs
- ListViewDeleteEventArgs.cs
- HGlobalSafeHandle.cs
- EncoderParameter.cs
- GridView.cs
- ScalarType.cs
- ResetableIterator.cs
- ItemAutomationPeer.cs
- SoapDocumentMethodAttribute.cs
- XPathBuilder.cs
- XmlReflectionMember.cs
- SendParametersContent.cs
- RuntimeArgumentHandle.cs
- dataSvcMapFileLoader.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- HtmlInputCheckBox.cs
- webproxy.cs
- PathGradientBrush.cs
- SqlReorderer.cs
- BufferedGraphics.cs
- SurrogateEncoder.cs
- MethodToken.cs
- ReachDocumentPageSerializer.cs
- ItemsPanelTemplate.cs
- CounterCreationData.cs