-
Notifications
You must be signed in to change notification settings - Fork 303
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
Dev macro manager #268
Dev macro manager #268
Conversation
…-manager # Conflicts: # source/RevitLookup/Core/ComponentModel/DescriptorMap.cs # source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs
…-manager # Conflicts: # source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs # source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs
} | ||
|
||
public void RegisterExtensions(IExtensionManager manager) | ||
{ | ||
manager.Register("GetFormulaFunctions", _ => FormulaManager.GetFunctions()); | ||
manager.Register("GetFormulaOperators", _ => FormulaManager.GetOperators()); | ||
manager.Register(nameof(MacroManager.GetMacroManager), _ => Variants.Single(MacroManager.GetMacroManager(_application))); |
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.
u can remove Variants.Single for extensions
nameof(MacroManager.GetDocumentMacroSecurityOptions) => ResolveDocumentMacroSecurityOptions, | ||
#endif | ||
nameof(MacroManager.GetApplicationMacroSecurityOptions) => ResolveApplicationMacroSecurityOptions, | ||
nameof(IEnumerable.GetEnumerator) => ResolveGetEnumerator, |
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.
GetEnumerator should be automatically resolved, what problem does using it in a Resolve method solve?
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 had some problems with it but resolved it. We really don't need this, I removed
@@ -36,6 +37,7 @@ public EnumerableDescriptor(IEnumerable value) | |||
IsEmpty = value switch | |||
{ | |||
string => true, | |||
MacroManager enumerable => enumerable.Count == 0, |
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.
Move it to the very bottom. In the top position you should insert frequently used types to increase the efficiency of resolving switching cases
Summary of the Pull Request
I added support to MacroManager class (and also we can see MacroModule and Macro)
Description:
Quality Checklist