-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflection_Engine: Added TryRunExtensionMethod #2357
Reflection_Engine: Added TryRunExtensionMethod #2357
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a found minor misconceptions in the descriptions - please see the code comments (plus possibly consider copy-pasting stuff from RunExtensionMethod
).
On top of that, I would consider two changes in the code itself:
- Adding a similar method taking allowing to call an extension method with other parameters than the target (similar as in
RunExtensionMethod
). - Refactoring the method to return
Output<bool, object>
instead ofbool
andout
param - this would allow using the method from the UI level, which may be a nice to have. However, in this case I would lean on @adecler to have the final say.
Co-authored-by: Pawel Baran <[email protected]>
My preference is to keep the |
Agreed with @alelom, the standard C# convention with However, due to the fact that the PR introduces a UI glitch (nonharmful, the UI is not crashing, it just looks weird), I would like @adecler to have a final say before we approve/merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with the out
parameter. It better aligns with the general C# conventions on the Try
methods and we will eventually support out
parameters in the UI anyways. In the meantime, people can just use the RunExtensionMethod
component in the UI if they ever need that for some reason.
@BHoMBot check all |
@pawelbaran to confirm, |
/azp run BHoM_Engine.CheckInstaller |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming LGTM, happy to see this merged.
Issues addressed by this PR
Closes #2348
Adds a TryRunExtensionMethod. If no method is found, returns false. Otherwise, invokes the method and passes the output in the
out
parameter, then returns true.Test files
Test with any choice of extension methods.
Changelog
Additional comments