Skip to content

Commit

Permalink
add a new feature: show in which version of Revit given API was intro…
Browse files Browse the repository at this point in the history
…duced
  • Loading branch information
NeVeSpl committed May 21, 2024
1 parent 616ad5a commit 25e6d4d
Show file tree
Hide file tree
Showing 5 changed files with 684 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace RevitDBExplorer.Domain.DataModel.Members.Base
{

internal class MemberDescriptor: IComparable<MemberDescriptor>, IEquatable<MemberDescriptor>
{
private readonly Lazy<DocXml> documentation;
Expand All @@ -19,6 +18,7 @@ internal class MemberDescriptor: IComparable<MemberDescriptor>, IEquatable<Membe
public IAccessor MemberAccessor { get; }
public Func<DocXml> DocumentationFactoryMethod { get; }
public DocXml Documentation => documentation?.Value ?? DocXml.Empty;
public string IntroducedInRevitVersion { get; init; }


public MemberDescriptor(Type forType, MemberKind memberKind, string name, Type declaringType, IAccessor memberAccessor, Func<DocXml> documentationFactoryMethod)
Expand All @@ -28,6 +28,7 @@ public MemberDescriptor(Type forType, MemberKind memberKind, string name, Type d
Name = name;
MemberAccessor = memberAccessor;
DocumentationFactoryMethod = documentationFactoryMethod;
IntroducedInRevitVersion = WhatIsNew.WhenIntroduced(memberAccessor.UniqueId);
if (documentationFactoryMethod != null)
{
this.documentation = new Lazy<DocXml>(documentationFactoryMethod);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class SnoopableMember : SnoopableItem
public override string Name => memberDescriptor.Name;
public DocXml Documentation => memberDescriptor.Documentation;
public override bool CanGenerateCode => memberDescriptor.Kind != MemberKind.None;

public string IntroducedInRevitVersion => memberDescriptor.IntroducedInRevitVersion;


public SnoopableMember(SnoopableObject parent, MemberDescriptor memberDescriptor) : base(parent, memberDescriptor.MemberAccessor)
Expand Down
Loading

0 comments on commit 25e6d4d

Please sign in to comment.