Announcement

Collapse
No announcement yet.

Deck.NET Enhancement / Possible ???

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Deck.NET Enhancement / Possible ???

    It would be nice to be able to test code like below in Deck.NET.

    Would it be possible to allow namespaces / using and the ability to use [Init] attributes in Deck.NET ?

    Thanks
    Andrew


    using Retyped;
    using static Retyped.jquery;
    using static Retyped.ej_web_all.ej;

    namespace SyncfusionDemo
    {
    public class Headers
    {
    public List<string> Stylesheets ;
    public List<string> Scripts;
    }

    public class App
    {
    public static void OnHeadersLoaded()
    {
    Console.WriteLine("*** OnHeadersLoaded ***");

    var btnModel = new Button.Model
    {
    size = ButtonSize.Large,
    showRoundedCorner = true,
    click = args => jQuery.select("#dialog1").ej_web_all().ejDialog("open")
    };

    // Use mapping method #1:
    jQuery.select("#button1").ej_web_all().ejButton(btnModel);

    // Use mapping method #2:
    jQuery.select("#dialog1").ej_web_all().ejDialog(new Dialog.Model
    {
    title = "Info",
    showOnInit = false
    });
    }

    [Init]
    public static void LoadHeaders()
    {
    Document.AddEventListener("readystatechange",x => OnHeadersLoaded());
    var head = Document.GetElementsByTagName("head")[0];

    Headers hdr = new Headers() {
    Stylesheets = new List<string> {
    "https://cdn.syncfusion.com/ej2/material.css"
    },
    Scripts = new List<string> {
    "https://cdn.syncfusion.com/ej2/dist/ej2.min.js"
    }
    };

    foreach (var s in hdr.Stylesheets)
    {
    var ss = new HTMLLinkElement
    {
    Rel = "stylesheet",
    Href = s,
    OnLoad = (arg) => { Console.WriteLine($"Loading {s}"); }
    };
    head.AppendChild(ss);
    }

    foreach (var l in hdr.Scripts)
    {
    var spt = new HTMLScriptElement
    {
    Src = l,
    OnLoad = (arg) => { Console.WriteLine($"Loading {l}"); }
    };

    head.AppendChild(spt);
    }
    }
    }
    }

    #2
    The [Init] attribute is supported in Deck, but importing the Retyped.ej_web_all.ej assembly is not. Currently, Deck only supports the base Retyped packages, and a few others such as Retyped.jquery.

    We hope to add the ability to import any Retyped package to Deck at some point once.

    Comment


      #3
      Thanks for the quick reply. Support for importing any Retyped packages would be great.. (it's handy being able to play/prototype ideas in Deck without firing up VS).

      Comment

      Working...
      X