// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // //using System.Management.Automation.Language; namespace Microsoft.SqlTools.EditorServices { /// /// Contains details about a specific region of text in script file. /// public sealed class ScriptRegion { #region Properties /// /// Gets the file path of the script file in which this region is contained. /// public string File { get; set; } /// /// Gets or sets the text that is contained within the region. /// public string Text { get; set; } /// /// Gets or sets the starting line number of the region. /// public int StartLineNumber { get; set; } /// /// Gets or sets the starting column number of the region. /// public int StartColumnNumber { get; set; } /// /// Gets or sets the starting file offset of the region. /// public int StartOffset { get; set; } /// /// Gets or sets the ending line number of the region. /// public int EndLineNumber { get; set; } /// /// Gets or sets the ending column number of the region. /// public int EndColumnNumber { get; set; } /// /// Gets or sets the ending file offset of the region. /// public int EndOffset { get; set; } #endregion #region Constructors #if false /// /// Creates a new instance of the ScriptRegion class from an /// instance of an IScriptExtent implementation. /// /// /// The IScriptExtent to copy into the ScriptRegion. /// /// /// A new ScriptRegion instance with the same details as the IScriptExtent. /// public static ScriptRegion Create(IScriptExtent scriptExtent) { return new ScriptRegion { File = scriptExtent.File, Text = scriptExtent.Text, StartLineNumber = scriptExtent.StartLineNumber, StartColumnNumber = scriptExtent.StartColumnNumber, StartOffset = scriptExtent.StartOffset, EndLineNumber = scriptExtent.EndLineNumber, EndColumnNumber = scriptExtent.EndColumnNumber, EndOffset = scriptExtent.EndOffset }; } #endif #endregion } }