Home
Options

Extend Hyperlinq() feature

It is possible to extend functionality with Action of Hyperlinq class for "new Hyperlinq((value) => {...}, ...)" in some new (beta) version? This would be great for comfortable interactive dumps..

Comments

  • Options
    How would this work? Would it be like new Hyperlinq (() => Util.ReadLine ("test").Dump(), "test")?
  • Options
    edited January 2018
    I know I can do it this way. But this is not exactly what I mean.. What I am talking about is this:
    var html1 = "<script>
    function button1_Click() {
    var value1 = JSON
    .stringify({
    text1: document
    .getElementById('text1')
    .value,
    text2: document
    .getElementById('text2')
    .value
    });

    window
    .external
    .RunUserAction(0,
    value1,
    false);
    }
    </script>
    <div>
    <label for='text1'>
    Text #1:
    </label>
    <input type='text' id='text1' />
    </div>
    <div>
    <label for='text2'>
    Text #2:
    </label>
    <input type='text' id='text2' />
    </div>
    <div>
    <button onclick='button1_Click();'>
    Test #1
    </button>
    </div>
    <hr/>";

    Util
    .RawHtml("<style> a.hidden { display: none; }</style>")
    .Dump();

    (new Hyperlinq((value) => { ... JsonConvert.DeserializeObject<SomeType>(value); ... }, ".")
    {
    CssClass = "hidden"
    }).Dump();

    Util
    .RawHtml(html1)
    .Dump();
    This way would be possible to build complex html forms to gather some LINQPad query parameters (for example) directly in results pane.. And I am pretty sure, that many LINQPad users would appreciate this feature.

    PS: If there will be option to identify Hyperlinq action with some string Id too (not only position) then the call from html could be ..RunUserAction('myAction1'...) and this will be really cool ;)
Sign In or Register to comment.