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
- PeerResolverSettings.cs
- Debug.cs
- CustomValidator.cs
- ValidationSummaryDesigner.cs
- ComponentFactoryHelpers.cs
- RotationValidation.cs
- SqlDuplicator.cs
- precedingsibling.cs
- Message.cs
- Visitor.cs
- messageonlyhwndwrapper.cs
- GroupPartitionExpr.cs
- WrappedKeySecurityTokenParameters.cs
- BasePattern.cs
- SimpleWebHandlerParser.cs
- CompilationAssemblyInstallComponent.cs
- BindingBase.cs
- LogExtentCollection.cs
- StringDictionaryCodeDomSerializer.cs
- CalendarTable.cs
- SystemColors.cs
- Utility.cs
- DebugView.cs
- DeviceContext.cs
- MimeBasePart.cs
- BindingContext.cs
- Brush.cs
- XmlNodeChangedEventArgs.cs
- XPathAxisIterator.cs
- UnsafeNativeMethods.cs
- CheckBox.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- ApplicationActivator.cs
- GridLength.cs
- OdbcEnvironment.cs
- ApplyTemplatesAction.cs
- ScrollBarRenderer.cs
- Popup.cs
- Inflater.cs
- RuleRefElement.cs
- PropertiesTab.cs
- TextPenaltyModule.cs
- ToolStripScrollButton.cs
- UrlMappingsSection.cs
- CapabilitiesAssignment.cs
- ConfigurationStrings.cs
- ProcessThread.cs
- XmlNamespaceDeclarationsAttribute.cs
- TCPListener.cs
- Missing.cs
- ChangePasswordAutoFormat.cs
- PieceNameHelper.cs
- FixedTextSelectionProcessor.cs
- WebEventTraceProvider.cs
- WinCategoryAttribute.cs
- ExtensionElement.cs
- OrCondition.cs
- ConnectionStringsExpressionBuilder.cs
- LinqToSqlWrapper.cs
- PlanCompiler.cs
- prefixendpointaddressmessagefiltertable.cs
- TextPointerBase.cs
- KeyValueConfigurationElement.cs
- _LoggingObject.cs
- FormViewUpdatedEventArgs.cs
- SqlNodeAnnotation.cs
- VariableExpressionConverter.cs
- Attributes.cs
- storepermissionattribute.cs
- CommandEventArgs.cs
- HtmlShimManager.cs
- SID.cs
- DataStorage.cs
- ImageListStreamer.cs
- SessionStateModule.cs
- SqlMetaData.cs
- LinearGradientBrush.cs
- SqlClientWrapperSmiStreamChars.cs
- HttpHeaderCollection.cs
- QueryGenerator.cs
- InstalledVoice.cs
- MimeBasePart.cs
- IOThreadTimer.cs
- TableLayoutPanel.cs
- Int64AnimationUsingKeyFrames.cs
- ReturnEventArgs.cs
- CompatibleComparer.cs
- SizeKeyFrameCollection.cs
- DataObjectMethodAttribute.cs
- AddInAdapter.cs
- CachedFontFamily.cs
- TraceHandlerErrorFormatter.cs
- SessionKeyExpiredException.cs
- Material.cs
- XmlWrappingWriter.cs
- Dictionary.cs
- Pointer.cs
- WebServiceErrorEvent.cs
- RangeValuePattern.cs
- AnimationException.cs