Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / XmlUtils / System / Xml / Xsl / SourceLineInfo.cs / 1 / SourceLineInfo.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System.Diagnostics; namespace System.Xml.Xsl { [DebuggerDisplay("{uriString} [{startLine},{startPos} -- {endLine},{endPos}]")] internal class SourceLineInfo : ISourceLineInfo { private string uriString; private int startLine; private int startPos; private int endLine; private int endPos; public SourceLineInfo(string uriString, int startLine, int startPos, int endLine, int endPos) { this.uriString = uriString; this.startLine = startLine; this.startPos = startPos; this.endLine = endLine; this.endPos = endPos; } public string Uri { get { return this.uriString; } } public int StartLine { get { return this.startLine; } } public int StartPos { get { return this.startPos ; } } public int EndLine { get { return this.endLine ; } } public int EndPos { get { return this.endPos ; } } internal void SetEndLinePos(int endLine, int endPos) { this.endLine = endLine; this.endPos = endPos; } ////// Magic number 0xfeefee is used in PDB to denote a section of IL that does not map to any user code. /// When VS debugger steps into IL marked with 0xfeefee, it will continue the step until it reaches /// some user code. /// private const int NoSourceMagicNumber = 0xfeefee; public static SourceLineInfo NoSource = new SourceLineInfo(string.Empty, NoSourceMagicNumber, 0, NoSourceMagicNumber, 0); public bool IsNoSource { get { return this.startLine == NoSourceMagicNumber; } } [Conditional("DEBUG")] public static void Validate(ISourceLineInfo lineInfo) { if (lineInfo.StartLine == 0 || lineInfo.StartLine == NoSourceMagicNumber) { Debug.Assert(lineInfo.StartLine == lineInfo.EndLine); Debug.Assert(lineInfo.StartPos == 0 && lineInfo.EndPos == 0); } else { Debug.Assert(0 < lineInfo.StartLine && lineInfo.StartLine <= lineInfo.EndLine); if (lineInfo.StartLine == lineInfo.EndLine) { Debug.Assert(0 < lineInfo.StartPos && lineInfo.StartPos < lineInfo.EndPos); } else { Debug.Assert(0 < lineInfo.StartPos && 0 < lineInfo.EndPos); } } } // Returns file path for local and network URIs. Used for PDB generating and error reporting. public static string GetFileName(string uriString) { Uri uri; if (uriString.Length != 0 && System.Uri.TryCreate(uriString, UriKind.Absolute, out uri) && uri.IsFile ) { return uri.LocalPath; } return uriString; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System.Diagnostics; namespace System.Xml.Xsl { [DebuggerDisplay("{uriString} [{startLine},{startPos} -- {endLine},{endPos}]")] internal class SourceLineInfo : ISourceLineInfo { private string uriString; private int startLine; private int startPos; private int endLine; private int endPos; public SourceLineInfo(string uriString, int startLine, int startPos, int endLine, int endPos) { this.uriString = uriString; this.startLine = startLine; this.startPos = startPos; this.endLine = endLine; this.endPos = endPos; } public string Uri { get { return this.uriString; } } public int StartLine { get { return this.startLine; } } public int StartPos { get { return this.startPos ; } } public int EndLine { get { return this.endLine ; } } public int EndPos { get { return this.endPos ; } } internal void SetEndLinePos(int endLine, int endPos) { this.endLine = endLine; this.endPos = endPos; } ////// Magic number 0xfeefee is used in PDB to denote a section of IL that does not map to any user code. /// When VS debugger steps into IL marked with 0xfeefee, it will continue the step until it reaches /// some user code. /// private const int NoSourceMagicNumber = 0xfeefee; public static SourceLineInfo NoSource = new SourceLineInfo(string.Empty, NoSourceMagicNumber, 0, NoSourceMagicNumber, 0); public bool IsNoSource { get { return this.startLine == NoSourceMagicNumber; } } [Conditional("DEBUG")] public static void Validate(ISourceLineInfo lineInfo) { if (lineInfo.StartLine == 0 || lineInfo.StartLine == NoSourceMagicNumber) { Debug.Assert(lineInfo.StartLine == lineInfo.EndLine); Debug.Assert(lineInfo.StartPos == 0 && lineInfo.EndPos == 0); } else { Debug.Assert(0 < lineInfo.StartLine && lineInfo.StartLine <= lineInfo.EndLine); if (lineInfo.StartLine == lineInfo.EndLine) { Debug.Assert(0 < lineInfo.StartPos && lineInfo.StartPos < lineInfo.EndPos); } else { Debug.Assert(0 < lineInfo.StartPos && 0 < lineInfo.EndPos); } } } // Returns file path for local and network URIs. Used for PDB generating and error reporting. public static string GetFileName(string uriString) { Uri uri; if (uriString.Length != 0 && System.Uri.TryCreate(uriString, UriKind.Absolute, out uri) && uri.IsFile ) { return uri.LocalPath; } return uriString; } } } // 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
- IRCollection.cs
- PointCollection.cs
- DataServiceExpressionVisitor.cs
- CaseInsensitiveHashCodeProvider.cs
- ObjectList.cs
- ProxyManager.cs
- HostingEnvironmentException.cs
- PeerNearMe.cs
- ProfessionalColors.cs
- PublisherMembershipCondition.cs
- GridLengthConverter.cs
- EditingMode.cs
- Message.cs
- TemplateBindingExtension.cs
- QilTargetType.cs
- _BasicClient.cs
- TransformerInfoCollection.cs
- ConstraintEnumerator.cs
- DataRowExtensions.cs
- InternalPolicyElement.cs
- HttpCookieCollection.cs
- ReadContentAsBinaryHelper.cs
- ExpressionCopier.cs
- FontSourceCollection.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- PropertyTabChangedEvent.cs
- ContentPosition.cs
- FixedPosition.cs
- ListMarkerLine.cs
- TreeNodeCollection.cs
- Helpers.cs
- IdnMapping.cs
- xamlnodes.cs
- BitmapEditor.cs
- SqlConnectionFactory.cs
- SqlPersonalizationProvider.cs
- CqlParser.cs
- FocusTracker.cs
- SizeConverter.cs
- ToolStripRenderEventArgs.cs
- UIElementIsland.cs
- BehaviorService.cs
- PnrpPermission.cs
- ResourceAttributes.cs
- PagerSettings.cs
- MessageBox.cs
- ConstructorExpr.cs
- ResourceContainer.cs
- PropertyEmitter.cs
- ToolStripSettings.cs
- WebExceptionStatus.cs
- BitmapFrameEncode.cs
- RenderDataDrawingContext.cs
- _StreamFramer.cs
- BodyWriter.cs
- IODescriptionAttribute.cs
- CategoryEditor.cs
- RegexWorker.cs
- WindowsIPAddress.cs
- CustomPopupPlacement.cs
- ProtocolElement.cs
- RIPEMD160Managed.cs
- WindowsAuthenticationEventArgs.cs
- Part.cs
- ScrollChangedEventArgs.cs
- NavigationHelper.cs
- ConfigXmlSignificantWhitespace.cs
- SchemaTypeEmitter.cs
- VisualTarget.cs
- BooleanExpr.cs
- DesignerUtils.cs
- SqlCacheDependencyDatabaseCollection.cs
- BinaryObjectReader.cs
- LinearGradientBrush.cs
- GridView.cs
- PositiveTimeSpanValidator.cs
- SimpleWebHandlerParser.cs
- AnnotationMap.cs
- MouseDevice.cs
- ExtentCqlBlock.cs
- OracleEncoding.cs
- EnumerableRowCollection.cs
- Fx.cs
- DockPattern.cs
- ReferencedCollectionType.cs
- OutputCacheProfileCollection.cs
- WorkflowServiceOperationListItem.cs
- Configuration.cs
- CodeArrayCreateExpression.cs
- PageThemeParser.cs
- NetworkInformationPermission.cs
- SqlDeflator.cs
- CallbackValidator.cs
- DataViewSetting.cs
- XMLUtil.cs
- HMAC.cs
- Visitors.cs
- BaseComponentEditor.cs
- WebInvokeAttribute.cs
- ViewCellRelation.cs