forked from codecadwallader/codemaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeItemUsingStatement.cs
More file actions
50 lines (42 loc) · 1.45 KB
/
CodeItemUsingStatement.cs
File metadata and controls
50 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
namespace SteveCadwallader.CodeMaid.Model.CodeItems
{
/// <summary>
/// The representation of a code using statemen.
/// </summary>
public class CodeItemUsingStatement : BaseCodeItemElement
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="CodeItemUsingStatement" /> class.
/// </summary>
public CodeItemUsingStatement()
{
_TypeString = new Lazy<string>(
() => "using");
}
#endregion Constructors
#region BaseCodeItem Overrides
/// <summary>
/// Gets the kind.
/// </summary>
public override KindCodeItem Kind => KindCodeItem.Using;
/// <summary>
/// Refreshes the cached position and name fields on this item.
/// </summary>
/// <remarks>
/// Similar to BaseCodeItemElement's implementation, except ignores the Name property which
/// is not available for using statements.
/// </remarks>
public override void RefreshCachedPositionAndName()
{
var startPoint = CodeElement.GetStartPoint();
var endPoint = CodeElement.GetEndPoint();
StartLine = startPoint.Line;
StartOffset = startPoint.AbsoluteCharOffset;
EndLine = endPoint.Line;
EndOffset = endPoint.AbsoluteCharOffset;
}
#endregion BaseCodeItem Overrides
}
}