Skip to content

Commit

Permalink
add support for static IsLoaded of RevitLinkType
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyNefyodov committed Mar 31, 2024
1 parent f4be822 commit a44818f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ namespace RevitLookup.Core.ComponentModel.Descriptors;

public sealed class RevitLinkTypeDescriptor(Element element) : ElementDescriptor(element), IDescriptorResolver
{
private readonly Element _element = element;

public new ResolveSet Resolve(Document context, string target, ParameterInfo[] parameters)
{
return target switch
{
nameof(RevitLinkType.Load) => ResolveSet.Append(new LinkLoadResult(), "Overridden"),
nameof(RevitLinkType.Reload) => ResolveSet.Append(new LinkLoadResult(), "Overridden"),
nameof(RevitLinkType.IsLoaded) => ResolveSet.Append(RevitLinkType.IsLoaded(_element.Document, _element.Id)),
_ => null
};
}
Expand Down

0 comments on commit a44818f

Please sign in to comment.