Skip to content

Commit c1ccd84

Browse files
committed
Use auto property
1 parent 82b5bbf commit c1ccd84

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Rubberduck.Parsing/Symbols/Declaration.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public Declaration(
132132
AttributesPassContext = attributesPassContext;
133133
IsUserDefined = isUserDefined;
134134
_annotations = annotations;
135-
_attributes = attributes ?? new Attributes();
135+
Attributes = attributes ?? new Attributes();
136136

137137
ProjectId = QualifiedName.QualifiedModuleName.ProjectId;
138138
var projectDeclaration = GetProjectParent(parentDeclaration);
@@ -277,9 +277,7 @@ public static Declaration GetProjectParent(Declaration declaration)
277277

278278
protected IEnumerable<IAnnotation> _annotations;
279279
public IEnumerable<IAnnotation> Annotations => _annotations ?? new List<IAnnotation>();
280-
281-
private readonly Attributes _attributes;
282-
public Attributes Attributes => _attributes;
280+
public Attributes Attributes { get; }
283281

284282
/// <summary>
285283
/// Gets an attribute value that contains the docstring for a member.
@@ -290,14 +288,14 @@ public string DescriptionString
290288
{
291289
string literalDescription;
292290

293-
var memberAttribute = _attributes.SingleOrDefault(a => a.Name == $"{IdentifierName}.VB_Description");
291+
var memberAttribute = Attributes.SingleOrDefault(a => a.Name == $"{IdentifierName}.VB_Description");
294292
if (memberAttribute != null)
295293
{
296294
literalDescription = memberAttribute.Values.SingleOrDefault() ?? string.Empty;
297295
return CorrectlyFormatedDescription(literalDescription);
298296
}
299297

300-
var moduleAttribute = _attributes.SingleOrDefault(a => a.Name == "VB_Description");
298+
var moduleAttribute = Attributes.SingleOrDefault(a => a.Name == "VB_Description");
301299
if (moduleAttribute != null)
302300
{
303301
literalDescription = moduleAttribute.Values.SingleOrDefault() ?? string.Empty;
@@ -327,7 +325,7 @@ private static string CorrectlyFormatedDescription(string literalDescription)
327325
/// Gets an attribute value indicating whether a member is an enumerator provider.
328326
/// Types with such a member support For Each iteration.
329327
/// </summary>
330-
public bool IsEnumeratorMember => _attributes.Any(a => a.Name.EndsWith("VB_UserMemId") && a.Values.Contains("-4"));
328+
public bool IsEnumeratorMember => Attributes.Any(a => a.Name.EndsWith("VB_UserMemId") && a.Values.Contains("-4"));
331329

332330
public virtual bool IsObject => !IsArray && IsObjectOrObjectArray;
333331

0 commit comments

Comments
 (0)