forked from codecadwallader/codemaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeItemDelegate.cs
More file actions
88 lines (67 loc) · 2.35 KB
/
CodeItemDelegate.cs
File metadata and controls
88 lines (67 loc) · 2.35 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using EnvDTE;
using EnvDTE80;
using System;
using System.Collections.Generic;
using System.Linq;
namespace SteveCadwallader.CodeMaid.Model.CodeItems
{
/// <summary>
/// The representation of a code delegate.
/// </summary>
public class CodeItemDelegate : BaseCodeItemElement, ICodeItemParameters
{
#region Fields
private readonly Lazy<string> _namespace;
private readonly Lazy<IEnumerable<CodeParameter>> _parameters;
#endregion Fields
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="CodeItemDelegate" /> class.
/// </summary>
public CodeItemDelegate()
{
_Access = LazyTryDefault(
() => CodeDelegate?.Access ?? vsCMAccess.vsCMAccessPublic);
_Attributes = LazyTryDefault(
() => CodeDelegate?.Attributes);
_DocComment = LazyTryDefault(
() => CodeDelegate?.DocComment);
_namespace = LazyTryDefault(
() => CodeDelegate?.Namespace?.Name);
_parameters = LazyTryDefault(
() => CodeDelegate?.Parameters?.Cast<CodeParameter>().ToList() ?? Enumerable.Empty<CodeParameter>());
_TypeString = new Lazy<string>(
() => "delegate");
}
#endregion Constructors
#region BaseCodeItem Overrides
/// <summary>
/// Gets the kind.
/// </summary>
public override KindCodeItem Kind => KindCodeItem.Delegate;
/// <summary>
/// Loads all lazy initialized values immediately.
/// </summary>
public override void LoadLazyInitializedValues()
{
base.LoadLazyInitializedValues();
var ns = Namespace;
var p = Parameters;
}
#endregion BaseCodeItem Overrides
#region Properties
/// <summary>
/// Gets or sets the underlying VSX CodeDelegate.
/// </summary>
public CodeDelegate2 CodeDelegate { get; set; }
/// <summary>
/// Gets the namespace.
/// </summary>
public string Namespace => _namespace.Value;
/// <summary>
/// Gets the parameters.
/// </summary>
public IEnumerable<CodeParameter> Parameters => _parameters.Value;
#endregion Properties
}
}