Skip to content

plugins nodes #1

@gregorvilkner

Description

@gregorvilkner

Hi there,

got a suggestion for AddElement_Click(object sender, RoutedEventArgs e) in the dynBench.xaml.cs.

currently you won't make it past the builtinTypes[mi.Header.ToString()] for types that are in the userTypes collection.

Is the User Node supposed to work? Even as a node that doesn't do anything? Here it doesn't manage to initialize a new node.

Kind regards,
Gregor

    private void AddElement_Click(object sender, RoutedEventArgs e)
    {
        System.Windows.Controls.MenuItem mi = e.Source as System.Windows.Controls.MenuItem;

        TypeLoadData tld = null;
        if (builtinTypes.ContainsKey(mi.Header.ToString()))
        {
            tld = builtinTypes[mi.Header.ToString()] as TypeLoadData;
            ...
        }
        else if (userTypes.ContainsKey(mi.Header.ToString()))
        {
            tld = userTypes[mi.Header.ToString()] as TypeLoadData;
            if (tld != null)
            {
                dynElement newEl = AddDynElement(tld.t, tld.assembly, mi.Header.ToString(), Guid.NewGuid(), 0.0, 0.0);
                ...
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions