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
- ConstraintStruct.cs
- SHA384.cs
- SchemaImporterExtensionElementCollection.cs
- WaitHandleCannotBeOpenedException.cs
- OpCopier.cs
- ToolStripScrollButton.cs
- RangeValueProviderWrapper.cs
- TdsParserSessionPool.cs
- ListViewSortEventArgs.cs
- DataStreamFromComStream.cs
- DoubleCollectionConverter.cs
- XmlSchemaObject.cs
- FormatterConverter.cs
- SimpleRecyclingCache.cs
- dbdatarecord.cs
- AsymmetricKeyExchangeDeformatter.cs
- EdmItemCollection.OcAssemblyCache.cs
- DataMemberListEditor.cs
- ListViewHitTestInfo.cs
- InProcStateClientManager.cs
- DragDropHelper.cs
- ReaderWriterLockSlim.cs
- NameValueFileSectionHandler.cs
- SchemaSetCompiler.cs
- ClrPerspective.cs
- WizardStepCollectionEditor.cs
- AuthorizationRuleCollection.cs
- HtmlMeta.cs
- X509ChainElement.cs
- TargetConverter.cs
- Enum.cs
- HttpRuntimeSection.cs
- LinqDataSourceHelper.cs
- ComAwareEventInfo.cs
- SQLGuidStorage.cs
- SecurityBindingElementImporter.cs
- MethodRental.cs
- BypassElement.cs
- Win32.cs
- HtmlElement.cs
- PolyLineSegmentFigureLogic.cs
- Stylus.cs
- EnumValAlphaComparer.cs
- SwitchAttribute.cs
- RemoveFromCollection.cs
- RijndaelManagedTransform.cs
- UriExt.cs
- WindowsListView.cs
- SafeArrayRankMismatchException.cs
- LicFileLicenseProvider.cs
- CheckStoreFileValidityRequest.cs
- FileUtil.cs
- MetricEntry.cs
- CodeAttributeArgumentCollection.cs
- DataServiceKeyAttribute.cs
- CommandEventArgs.cs
- ProfileService.cs
- HtmlElementErrorEventArgs.cs
- Privilege.cs
- ActivityBuilderHelper.cs
- ProfileModule.cs
- MaxMessageSizeStream.cs
- StyleSheetDesigner.cs
- LabelLiteral.cs
- BasicExpandProvider.cs
- SecurityContextCookieSerializer.cs
- XmlToDatasetMap.cs
- Font.cs
- ConfigXmlElement.cs
- StringToken.cs
- Nodes.cs
- RangeBase.cs
- ActivationServices.cs
- WebScriptEnablingBehavior.cs
- DocobjHost.cs
- ControlPropertyNameConverter.cs
- XmlnsCompatibleWithAttribute.cs
- mactripleDES.cs
- TableRow.cs
- TextRunCacheImp.cs
- CheckBoxRenderer.cs
- GZipStream.cs
- HasCopySemanticsAttribute.cs
- IgnoreFlushAndCloseStream.cs
- HTMLTagNameToTypeMapper.cs
- NumberFormatInfo.cs
- HyperLinkField.cs
- EntityTransaction.cs
- ExpressionBuilderCollection.cs
- UnSafeCharBuffer.cs
- EntityRecordInfo.cs
- Pair.cs
- PrintPageEvent.cs
- COM2Enum.cs
- CompilerGeneratedAttribute.cs
- PresentationTraceSources.cs
- RelationshipEndMember.cs
- IListConverters.cs
- _BasicClient.cs
- Point4D.cs