Skip to content

Extensions must be reloaded to initialize collection in PropertyGrid #2652

Description

@RoboDoig

Description

In some cases, a C# extension that contains a collection (e.g. List) as a property may not initialise its collection when added to the workflow.

Steps to reproduce

  1. Create a new bonsai environment
  2. Create a CSharpSource as an extension and create an operator with a collection property:
using Bonsai;
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;

[Combinator]
[Description("")]
[WorkflowElementCategory(ElementCategory.Source)]
public class SourceScript
{
    public List<double> Collection {get; set;}
    public IObservable<int> Process()
    {
        return Observable.Never(0);
    }
}
  1. Reload extensions in the editor, the collection for this operator should be editable
  2. Add a new instance of this operator to the workflow, the collection on the new operator is not editable/saveable until extensions are reloaded.

Bonsai version

2.9.1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions