Skip to content
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

New attribute AutoTypeMenuAttribute #82

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DhafinFawwaz
Copy link

Description

AutoTypeMenuAttribute does the same thing as AddTypeMenuAttribute but specifying the path is not needed. It will automatically add the path recursively to all the sub classes as well. You can add it to both the parent class or the sub class. Adding it just for the sub class is useful for case when you still want to customize the path for other classes. Basically, this attribute is usefull if you have a lot of subclass and you don't want to specify each one.

Example 1:
A1 [AutoTypeMenu]
- B1
- B2
-- C1
-- C2
--- D1
--- D2
--- D3
---- E1
---- E2
-- C3
- B3
the search dropdown will be
B1
B2
B2/C1
B2/C2
B2/C2/D1
B2/C2/D2
B2/C2/D3
B2/C2/D3/E1
B2/C2/D3/E2
B2/C3
B3

Example 2:
A1
- B1
- B2
-- C1
-- C2 [AutoTypeMenu]
--- D1
--- D2
--- D3
---- E1
---- E2
-- C3
- B3
the search dropdown will be
B1
B2
C1
C2
C2/D1
C2/D2
C2/D3
C2/D3/E1
C2/D3/E2
C3
B3

Changes made

  • New class AutoTypeMenuAttribute
  • More example
  • AdvancedTypePopup needs to receive information about the base type which will be passed to the AddTo function and passed to the GetSplittedTypePath function. It also have extra logic to set the isSingleNamespace to false if any of the type has this attribute attached to them.
  • Caching for the result of the recursive search to find the AutoTypeMenuAttribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant