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
- FontStyle.cs
- IDQuery.cs
- GorillaCodec.cs
- EndPoint.cs
- CommandField.cs
- ScriptComponentDescriptor.cs
- DataGridColumnHeaderCollection.cs
- CheckBoxPopupAdapter.cs
- TextElement.cs
- TableLayoutPanel.cs
- JsonStringDataContract.cs
- SqlConnectionStringBuilder.cs
- TreeViewAutomationPeer.cs
- Point3DCollection.cs
- TransformDescriptor.cs
- HostedNamedPipeTransportManager.cs
- RequestNavigateEventArgs.cs
- HighlightVisual.cs
- wmiprovider.cs
- PolicyManager.cs
- regiisutil.cs
- NativeWindow.cs
- PixelShader.cs
- EventListenerClientSide.cs
- WebBrowserUriTypeConverter.cs
- ListItemParagraph.cs
- _SslSessionsCache.cs
- ButtonAutomationPeer.cs
- dataprotectionpermission.cs
- LongTypeConverter.cs
- Hyperlink.cs
- BitmapEffect.cs
- PaintEvent.cs
- WebPartConnectionCollection.cs
- ExecutionContext.cs
- ListBox.cs
- X509UI.cs
- WsdlInspector.cs
- DecimalConverter.cs
- Soap12ServerProtocol.cs
- EntityConnectionStringBuilderItem.cs
- HttpCookiesSection.cs
- Sql8ConformanceChecker.cs
- Configuration.cs
- Schema.cs
- ManifestResourceInfo.cs
- XPathNode.cs
- XmlSchemaElement.cs
- EventRoute.cs
- TreeNodeStyle.cs
- dataprotectionpermission.cs
- StickyNoteContentControl.cs
- ServiceThrottle.cs
- PathTooLongException.cs
- ProtocolElement.cs
- ViewService.cs
- ListChangedEventArgs.cs
- COM2ExtendedUITypeEditor.cs
- PagesSection.cs
- ParallelQuery.cs
- TiffBitmapEncoder.cs
- JavaScriptString.cs
- SelectionWordBreaker.cs
- MembershipPasswordException.cs
- StructuredCompositeActivityDesigner.cs
- ActionFrame.cs
- RegexReplacement.cs
- OperationCanceledException.cs
- DbgCompiler.cs
- TdsRecordBufferSetter.cs
- DSACryptoServiceProvider.cs
- RotateTransform3D.cs
- PrivilegedConfigurationManager.cs
- TraceRecord.cs
- CroppedBitmap.cs
- AuthorizationContext.cs
- FixedSOMTableRow.cs
- BindingSource.cs
- RangeValidator.cs
- CompatibleComparer.cs
- RenameRuleObjectDialog.Designer.cs
- HttpConfigurationContext.cs
- ListViewEditEventArgs.cs
- Stopwatch.cs
- __Filters.cs
- TopClause.cs
- Translator.cs
- SQLResource.cs
- XsdBuildProvider.cs
- ImageDrawing.cs
- DataBindingCollectionEditor.cs
- ThousandthOfEmRealDoubles.cs
- ClockController.cs
- PropertyEntry.cs
- TypeDependencyAttribute.cs
- CalendarKeyboardHelper.cs
- TrustManager.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- LongTypeConverter.cs
- SmiSettersStream.cs