Skip to content

typescript types sent via commands cant be passed to c# side via ISimple commands #171

@jmecosta

Description

@jmecosta

Have this interface in typescript

export interface ITafCommand {
  Execute(data:any) : void;
}

Call it with from typescript side

this.tafRunnerModel?.SaveSearchCommand?.Execute(addSearchList);

or html

@click="viewModel.tafRunnerModel.SaveSearchCommand.Execute(currentSearchList)"

if addSearchList is string or empty, the glue is able to pass on the data to c#!

if having a type like this

export class TafSearchList {
  constructor(
    public SearchListName?: string,
    public SearchData?: string
  ) {}
}
    [Serializable]
    public class TafSearchList
    {
        public string SearchListName { set; get; }
        public string SearchData { set; get; }
    }

I get this

>	Neutronium.Core.dll!Neutronium.Core.Binding.Mapper.JavascriptToGlueMapper.GetGlueConvertible(Neutronium.Core.WebBrowserEngine.JavascriptObject.IJavascriptObject javascriptObject, System.Type targetType) Line 45	C#
 	Neutronium.Core.dll!Neutronium.Core.Extension.JavascriptToGlueMapperExtension.GetFirstArgument<object>(Neutronium.Core.Binding.Mapper.IJavascriptToGlueMapper converter, Neutronium.Core.WebBrowserEngine.JavascriptObject.IJavascriptObject[] javascriptObjects) Line 21	C#
 	Neutronium.Core.dll!Neutronium.Core.Binding.GlueObject.Executable.JsSimpleCommand<object>.Neutronium.Core.Binding.GlueObject.IExecutableGlue.Execute(Neutronium.Core.WebBrowserEngine.JavascriptObject.IJavascriptObject[] e) Line 41	C#
 	Neutronium.Core.dll!Neutronium.Core.Binding.Builder.BulkJsHelper.ExecuteExecutable(Neutronium.Core.WebBrowserEngine.JavascriptObject.IJavascriptObject[] arguments) Line 39	C#
 	Neutronium.WebBrowserEngine.ChromiumFx.dll!Neutronium.WebBrowserEngine.ChromiumFx.Convertion.CfrV8HandlerHelper.Convert.AnonymousMethod__0(object o, Chromium.Remote.Event.CfrV8HandlerExecuteEventArgs e) Line 19	C#

Know issue, or am i doing something incorrectly?

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