Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Scripting / Ast / DebugInfoExpression.cs / 1305376 / DebugInfoExpression.cs
/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Diagnostics; using System.Dynamic.Utils; #if SILVERLIGHT using System.Core; #endif namespace System.Linq.Expressions { ////// Emits or clears a sequence point for debug information. /// /// This allows the debugger to highlight the correct source code when /// debugging. /// #if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.DebugInfoExpressionProxy))] #endif public class DebugInfoExpression : Expression { private readonly SymbolDocumentInfo _document; internal DebugInfoExpression(SymbolDocumentInfo document) { _document = document; } ////// Gets the static type of the expression that this ///represents. (Inherited from .) /// The public sealed override Type Type { get { return typeof(void); } } ///that represents the static type of the expression. /// Returns the node type of this ///. (Inherited from .) /// The public sealed override ExpressionType NodeType { get { return ExpressionType.DebugInfo; } } ///that represents this expression. /// Gets the start line of this public virtual int StartLine { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the start column of this public virtual int StartColumn { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the end line of this public virtual int EndLine { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the end column of this public virtual int EndColumn { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the public SymbolDocumentInfo Document { get { return _document; } } ///that represents the source file. /// /// Gets the value to indicate if the public virtual bool IsClear { get { throw ContractUtils.Unreachable; } } ///is for clearing a sequence point. /// /// Dispatches to the specific visit method for this node type. /// protected internal override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitDebugInfo(this); } } #region Specialized subclasses internal sealed class SpanDebugInfoExpression : DebugInfoExpression { private readonly int _startLine, _startColumn, _endLine, _endColumn; internal SpanDebugInfoExpression(SymbolDocumentInfo document, int startLine, int startColumn, int endLine, int endColumn) : base(document) { _startLine = startLine; _startColumn = startColumn; _endLine = endLine; _endColumn = endColumn; } public override int StartLine { get { return _startLine; } } public override int StartColumn { get { return _startColumn; } } public override int EndLine { get { return _endLine; } } public override int EndColumn { get { return _endColumn; } } public override bool IsClear { get { return false; } } protected internal override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitDebugInfo(this); } } internal sealed class ClearDebugInfoExpression : DebugInfoExpression { internal ClearDebugInfoExpression(SymbolDocumentInfo document) : base(document) { } public override bool IsClear { get { return true; } } public override int StartLine { get { return 0xfeefee; } } public override int StartColumn { get { return 0; } } public override int EndLine { get { return 0xfeefee; } } public override int EndColumn { get { return 0; } } } #endregion public partial class Expression { ////// Creates a /// Thewith the specified span. /// that represents the source file. /// The start line of this . Must be greater than 0. /// The start column of this . Must be greater than 0. /// The end line of this . Must be greater or equal than the start line. /// The end column of this . If the end line is the same as the start line, it must be greater or equal than the start column. In any case, must be greater than 0. /// An instance of public static DebugInfoExpression DebugInfo(SymbolDocumentInfo document, int startLine, int startColumn, int endLine, int endColumn) { ContractUtils.RequiresNotNull(document, "document"); if (startLine == 0xfeefee && startColumn == 0 && endLine == 0xfeefee && endColumn == 0) { return new ClearDebugInfoExpression(document); } ValidateSpan(startLine, startColumn, endLine, endColumn); return new SpanDebugInfoExpression(document, startLine, startColumn, endLine, endColumn); } ///. /// Creates a /// Thefor clearing a sequence point. /// that represents the source file. /// An instance of public static DebugInfoExpression ClearDebugInfo(SymbolDocumentInfo document) { ContractUtils.RequiresNotNull(document, "document"); return new ClearDebugInfoExpression(document); } private static void ValidateSpan(int startLine, int startColumn, int endLine, int endColumn) { if (startLine < 1) { throw Error.OutOfRange("startLine", 1); } if (startColumn < 1) { throw Error.OutOfRange("startColumn", 1); } if (endLine < 1) { throw Error.OutOfRange("endLine", 1); } if (endColumn < 1) { throw Error.OutOfRange("endColumn", 1); } if (startLine > endLine) { throw Error.StartEndMustBeOrdered(); } if (startLine == endLine && startColumn > endColumn) { throw Error.StartEndMustBeOrdered(); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Diagnostics; using System.Dynamic.Utils; #if SILVERLIGHT using System.Core; #endif namespace System.Linq.Expressions { ///for clearning a sequence point. /// Emits or clears a sequence point for debug information. /// /// This allows the debugger to highlight the correct source code when /// debugging. /// #if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.DebugInfoExpressionProxy))] #endif public class DebugInfoExpression : Expression { private readonly SymbolDocumentInfo _document; internal DebugInfoExpression(SymbolDocumentInfo document) { _document = document; } ////// Gets the static type of the expression that this ///represents. (Inherited from .) /// The public sealed override Type Type { get { return typeof(void); } } ///that represents the static type of the expression. /// Returns the node type of this ///. (Inherited from .) /// The public sealed override ExpressionType NodeType { get { return ExpressionType.DebugInfo; } } ///that represents this expression. /// Gets the start line of this public virtual int StartLine { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the start column of this public virtual int StartColumn { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the end line of this public virtual int EndLine { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the end column of this public virtual int EndColumn { get { throw ContractUtils.Unreachable; } } ///. /// /// Gets the public SymbolDocumentInfo Document { get { return _document; } } ///that represents the source file. /// /// Gets the value to indicate if the public virtual bool IsClear { get { throw ContractUtils.Unreachable; } } ///is for clearing a sequence point. /// /// Dispatches to the specific visit method for this node type. /// protected internal override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitDebugInfo(this); } } #region Specialized subclasses internal sealed class SpanDebugInfoExpression : DebugInfoExpression { private readonly int _startLine, _startColumn, _endLine, _endColumn; internal SpanDebugInfoExpression(SymbolDocumentInfo document, int startLine, int startColumn, int endLine, int endColumn) : base(document) { _startLine = startLine; _startColumn = startColumn; _endLine = endLine; _endColumn = endColumn; } public override int StartLine { get { return _startLine; } } public override int StartColumn { get { return _startColumn; } } public override int EndLine { get { return _endLine; } } public override int EndColumn { get { return _endColumn; } } public override bool IsClear { get { return false; } } protected internal override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitDebugInfo(this); } } internal sealed class ClearDebugInfoExpression : DebugInfoExpression { internal ClearDebugInfoExpression(SymbolDocumentInfo document) : base(document) { } public override bool IsClear { get { return true; } } public override int StartLine { get { return 0xfeefee; } } public override int StartColumn { get { return 0; } } public override int EndLine { get { return 0xfeefee; } } public override int EndColumn { get { return 0; } } } #endregion public partial class Expression { ////// Creates a /// Thewith the specified span. /// that represents the source file. /// The start line of this . Must be greater than 0. /// The start column of this . Must be greater than 0. /// The end line of this . Must be greater or equal than the start line. /// The end column of this . If the end line is the same as the start line, it must be greater or equal than the start column. In any case, must be greater than 0. /// An instance of public static DebugInfoExpression DebugInfo(SymbolDocumentInfo document, int startLine, int startColumn, int endLine, int endColumn) { ContractUtils.RequiresNotNull(document, "document"); if (startLine == 0xfeefee && startColumn == 0 && endLine == 0xfeefee && endColumn == 0) { return new ClearDebugInfoExpression(document); } ValidateSpan(startLine, startColumn, endLine, endColumn); return new SpanDebugInfoExpression(document, startLine, startColumn, endLine, endColumn); } ///. /// Creates a /// Thefor clearing a sequence point. /// that represents the source file. /// An instance of public static DebugInfoExpression ClearDebugInfo(SymbolDocumentInfo document) { ContractUtils.RequiresNotNull(document, "document"); return new ClearDebugInfoExpression(document); } private static void ValidateSpan(int startLine, int startColumn, int endLine, int endColumn) { if (startLine < 1) { throw Error.OutOfRange("startLine", 1); } if (startColumn < 1) { throw Error.OutOfRange("startColumn", 1); } if (endLine < 1) { throw Error.OutOfRange("endLine", 1); } if (endColumn < 1) { throw Error.OutOfRange("endColumn", 1); } if (startLine > endLine) { throw Error.StartEndMustBeOrdered(); } if (startLine == endLine && startColumn > endColumn) { throw Error.StartEndMustBeOrdered(); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.for clearning a sequence point.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FileLoadException.cs
- RenderData.cs
- AnimationException.cs
- Point3DCollectionValueSerializer.cs
- EncodingDataItem.cs
- URIFormatException.cs
- XmlAttributeCollection.cs
- ClassicBorderDecorator.cs
- ContextItemManager.cs
- DataQuery.cs
- TimeSpanOrInfiniteConverter.cs
- WindowsFont.cs
- TransactedBatchContext.cs
- _AutoWebProxyScriptHelper.cs
- ToolBarButtonDesigner.cs
- TokenBasedSetEnumerator.cs
- ConnectionManagementElementCollection.cs
- SqlLiftIndependentRowExpressions.cs
- SectionInput.cs
- WpfXamlMember.cs
- KnownTypes.cs
- FlowLayoutSettings.cs
- Expression.cs
- EventMetadata.cs
- TextTreeNode.cs
- XmlElementCollection.cs
- FixedSOMPageElement.cs
- StreamAsIStream.cs
- SystemIPGlobalProperties.cs
- TemplateManager.cs
- MenuBase.cs
- XmlnsCache.cs
- _StreamFramer.cs
- ReflectionTypeLoadException.cs
- TrackBarRenderer.cs
- SingleAnimation.cs
- DataSourceCacheDurationConverter.cs
- WebPartCollection.cs
- WebPartDeleteVerb.cs
- MembershipValidatePasswordEventArgs.cs
- RSAOAEPKeyExchangeDeformatter.cs
- _Semaphore.cs
- SqlUserDefinedAggregateAttribute.cs
- HashSet.cs
- MailAddressCollection.cs
- XmlILIndex.cs
- SynchronizedDispatch.cs
- ListViewGroup.cs
- ListChangedEventArgs.cs
- SoapException.cs
- XmlDocument.cs
- ToolBarButtonClickEvent.cs
- Selection.cs
- SafeMemoryMappedFileHandle.cs
- BasicSecurityProfileVersion.cs
- RowBinding.cs
- CodeTypeOfExpression.cs
- DocumentCollection.cs
- BehaviorService.cs
- ParseHttpDate.cs
- XmlBinaryReader.cs
- ConstraintConverter.cs
- Span.cs
- Rect3D.cs
- BindingMemberInfo.cs
- CannotUnloadAppDomainException.cs
- WebPartZone.cs
- sqlnorm.cs
- AuthStoreRoleProvider.cs
- dataprotectionpermissionattribute.cs
- SettingsPropertyWrongTypeException.cs
- GroupItemAutomationPeer.cs
- JpegBitmapEncoder.cs
- NetworkInformationException.cs
- SchemaImporterExtensionsSection.cs
- CancellationState.cs
- InputMethodStateTypeInfo.cs
- WebPartExportVerb.cs
- DocumentViewerHelper.cs
- BitmapEffectInputData.cs
- AccessibleObject.cs
- AssemblyBuilder.cs
- ScriptDescriptor.cs
- DataControlLinkButton.cs
- Nodes.cs
- AssemblyBuilder.cs
- BindingValueChangedEventArgs.cs
- XmlWriterTraceListener.cs
- GeneralTransform3D.cs
- ConfigurationHelpers.cs
- FileUtil.cs
- EventSinkHelperWriter.cs
- TableCell.cs
- WebBrowsableAttribute.cs
- InvalidComObjectException.cs
- ChtmlPageAdapter.cs
- TextTabProperties.cs
- TypeElement.cs
- UIElement.cs
- WebPartConnectionsConnectVerb.cs