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

Dynamic NodeTypes #127

Open
Thistlebrew opened this issue Mar 21, 2024 · 0 comments
Open

Dynamic NodeTypes #127

Thistlebrew opened this issue Mar 21, 2024 · 0 comments

Comments

@Thistlebrew
Copy link

This may not fill a need with what you are doing with your project, but after messing around with your code, Which was super easy to figure out enough to start messing with which is great! I was investigating if this could be useable for other realms other than regular expressions. I was trying to see if I could make a visual CSV mapping tool off what you have done. The idea is that I could have a list of columns in the source document listed and a list of outputs that represent the columns in the resulting document, and then can allow a more visual process to say how the data should be mapped. To do this I would want to do something where I would read in the the header of the source CSV and then dynamically make node types for each column. More realistically, is probably the same "NodeType" but where the "Title" could be set up at dynamically at creation. The Value it would add to the output result would be it's Title.

image

The way the code is architected this seems impossible to do, at least from what I've found. First because of the way the inheritance is constructed it cannot be added to the base constructor to take in the property at creation time. the hybrid class gets in the way of that

image

The other thing that gets in the way if doing that, is the Activator calls that are made in other areas of the call that really can't use a constructor with a parameter.

image

Some of that I have been able to inelegantly overcome by making another property of category and then just checking for that category where I need to inject the title in when the activator calls are being made.

However the real issue is the GetValue() method override, it becomes impossible to do something like this method if the title property isn't implicitly set at start up.

image

Title will always come up blank:

image

While this might not ever be an issue with a regular expression engine you have built. If you ever split the node engine out to be used in other places this is something I could see needing to be addressed.

Otherwise this is a beautiful useful implementation that should be wider known. I only found it after a couple hours searching for a node engine I could plug into C#. I am more comfortable with Blazor than I am WPF so I was drawn into what your doing with your project. Good Work!

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

No branches or pull requests

1 participant