Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DynamicActionMessageFilter.cs
- objectresult_tresulttype.cs
- NavigationPropertySingletonExpression.cs
- Point3DCollection.cs
- GridLengthConverter.cs
- activationcontext.cs
- Message.cs
- KeyMatchBuilder.cs
- MetaData.cs
- MatrixUtil.cs
- wmiutil.cs
- CommandBindingCollection.cs
- Atom10FeedFormatter.cs
- ButtonBaseAdapter.cs
- QilSortKey.cs
- DataTemplateSelector.cs
- MatrixTransform.cs
- X509ScopedServiceCertificateElement.cs
- OdbcParameterCollection.cs
- Adorner.cs
- PropertyBuilder.cs
- InstanceHandle.cs
- HtmlTableRowCollection.cs
- XmlSchemaInferenceException.cs
- SingleObjectCollection.cs
- XmlSchemaImporter.cs
- SoundPlayerAction.cs
- SqlDataReader.cs
- ToolboxItemAttribute.cs
- WebPartsSection.cs
- GridItem.cs
- CompositionTarget.cs
- Menu.cs
- GroupQuery.cs
- ExtentKey.cs
- IndexedEnumerable.cs
- TemplatedMailWebEventProvider.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- XmlSchemaSimpleTypeRestriction.cs
- UserPreference.cs
- _NativeSSPI.cs
- InkPresenter.cs
- FormViewUpdateEventArgs.cs
- OperationFormatUse.cs
- METAHEADER.cs
- DecimalAnimation.cs
- DataKey.cs
- StorageFunctionMapping.cs
- Misc.cs
- WindowsButton.cs
- SuppressMergeCheckAttribute.cs
- SqlGenericUtil.cs
- DecoratedNameAttribute.cs
- SmiEventStream.cs
- SqlParameter.cs
- ChannelManagerBase.cs
- ImageFormatConverter.cs
- TextEditorTyping.cs
- Style.cs
- BindableAttribute.cs
- LocationInfo.cs
- PolyLineSegmentFigureLogic.cs
- UserInitiatedNavigationPermission.cs
- StorageConditionPropertyMapping.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- XmlBaseReader.cs
- SqlWebEventProvider.cs
- XmlElementElementCollection.cs
- SyncOperationState.cs
- _emptywebproxy.cs
- HttpRequestWrapper.cs
- Win32.cs
- SelectionListDesigner.cs
- DefaultExpression.cs
- ObjectDataSourceSelectingEventArgs.cs
- ScriptControl.cs
- SizeFConverter.cs
- MdiWindowListStrip.cs
- WsatServiceAddress.cs
- _ProxyChain.cs
- BidOverLoads.cs
- DocumentsTrace.cs
- PeerCredential.cs
- PatternMatcher.cs
- WorkflowPageSetupDialog.cs
- DictionaryTraceRecord.cs
- RoutingEndpointTrait.cs
- ListView.cs
- SqlErrorCollection.cs
- Setter.cs
- FileStream.cs
- XmlDocumentFragment.cs
- HtmlTernaryTree.cs
- BitmapEffectState.cs
- HtmlShimManager.cs
- SplitContainerDesigner.cs
- CultureInfo.cs
- RectangleF.cs
- XmlSchemaSimpleTypeUnion.cs
- IndependentAnimationStorage.cs