Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- NamespaceEmitter.cs
- DynamicDocumentPaginator.cs
- GenericPrincipal.cs
- StorageEndPropertyMapping.cs
- _ContextAwareResult.cs
- ResourceManagerWrapper.cs
- ConstraintEnumerator.cs
- XmlValidatingReader.cs
- MD5HashHelper.cs
- ToolStripContentPanelDesigner.cs
- SemanticKeyElement.cs
- PictureBoxDesigner.cs
- Maps.cs
- OperationResponse.cs
- WebPartsPersonalizationAuthorization.cs
- FixedSOMFixedBlock.cs
- DataGridTablesFactory.cs
- InvalidProgramException.cs
- CodeThrowExceptionStatement.cs
- ValidationRule.cs
- AuthenticationConfig.cs
- ObjectView.cs
- MarkupWriter.cs
- DbConnectionFactory.cs
- TextViewSelectionProcessor.cs
- _HTTPDateParse.cs
- HtmlWindow.cs
- SystemIPInterfaceStatistics.cs
- RijndaelManagedTransform.cs
- RelatedEnd.cs
- NativeActivityMetadata.cs
- TextRangeEdit.cs
- WebPartCancelEventArgs.cs
- LineSegment.cs
- CompilerCollection.cs
- SortedList.cs
- TextBoxBase.cs
- IItemContainerGenerator.cs
- ResourceLoader.cs
- IntersectQueryOperator.cs
- FieldDescriptor.cs
- _Rfc2616CacheValidators.cs
- FastEncoderWindow.cs
- PlacementWorkspace.cs
- SyndicationLink.cs
- DefaultTypeArgumentAttribute.cs
- TableLayoutPanel.cs
- WebServiceTypeData.cs
- StringExpressionSet.cs
- SendDesigner.xaml.cs
- XPathSelfQuery.cs
- MediaPlayerState.cs
- OutputWindow.cs
- StronglyTypedResourceBuilder.cs
- TableLayout.cs
- Transform.cs
- LinkedResource.cs
- ApplicationBuildProvider.cs
- Matrix.cs
- FileLoadException.cs
- Itemizer.cs
- PersistenceTypeAttribute.cs
- ClientUtils.cs
- MDIWindowDialog.cs
- RandomDelayQueuedSendsAsyncResult.cs
- DesigntimeLicenseContextSerializer.cs
- AsyncOperationManager.cs
- BindingNavigator.cs
- figurelength.cs
- GeometryConverter.cs
- LinqDataSourceEditData.cs
- SqlBuilder.cs
- UnsupportedPolicyOptionsException.cs
- xdrvalidator.cs
- StorageScalarPropertyMapping.cs
- CustomAttributeBuilder.cs
- AliasExpr.cs
- PrintDocument.cs
- DataViewListener.cs
- _TLSstream.cs
- RepeaterItem.cs
- TemplateBaseAction.cs
- DBCommand.cs
- TextCompositionEventArgs.cs
- SetIterators.cs
- Soap12ProtocolReflector.cs
- TemplatePartAttribute.cs
- TargetInvocationException.cs
- Rijndael.cs
- PostBackTrigger.cs
- _ConnectStream.cs
- Number.cs
- Win32.cs
- UTF32Encoding.cs
- ApplyTemplatesAction.cs
- SqlNode.cs
- XPathDocument.cs
- ImageMap.cs
- XmlLoader.cs
- HtmlFormParameterWriter.cs