Question

If I execute this VB expression:

New Hyperlinq("c:\temp\test.py").Dump()

as a result I get clickable link which opens the file with default application i.e. it runs this Python file.

I wanted to instruct LinqPad to custom Sub that will take care of click Event.
Hyperlinq Class contains Action parameter, but I can't find example how to use this method:

public Hyperlinq(string uriOrPath);
public Hyperlinq(QueryLanguage queryLanguage, string query);
public Hyperlinq(Action action, string text);
public Hyperlinq(string uriOrPath, string text);
public Hyperlinq(QueryLanguage queryLanguage, string query, string text);
public Hyperlinq(Action action, string text, bool runOnNewThread);
internal Hyperlinq(int editorRow, int editorColumn, string text);
public override bool Equals(object obj);
public override int GetHashCode();
internal int RegisterAction();

Can anyone provide an example?
For example I want to open the file with Notepad when I click on the link in the result pane.

Was it helpful?

Solution

dim h = New Hyperlinq(Function() "foo".Dump, "Click me")
h.Dump

OTHER TIPS

Here's the C# way to do the same thing as above

var h = new Hyperlinq(()=> {"foo".Dump();}, "Click me");
h.Dump();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top