Exemplo n.º 1
0
 static void Test2()
 {
     Avm.Class klass = Avm.Class.Find("Utils", "Msg");
     Utils.Msg msg   = (Utils.Msg)klass.CreateInstance();
     msg.value = "aaa";
     Console.WriteLine(msg.value);
 }
Exemplo n.º 2
0
 static void Test1()
 {
     Avm.Class  klass = Avm.Class.Find("", "Object");
     Avm.Object obj   = (Avm.Object)klass.CreateInstance();
     obj.SetProperty("a", "1");
     Console.WriteLine(obj.GetProperty("a"));
 }
Exemplo n.º 3
0
    public MyApp()
    {
        Function f = (Func) delegate
        {
            Alert.show("Hello World!!!");
        };

        f.call(null);

        Type type = typeof(Application);

        Avm.Class klass = type;
    }
Exemplo n.º 4
0
    public MyApp()
    {
        VDividedBox box = new VDividedBox();

        box.setStyle("left", 10);
        box.setStyle("right", 10);
        box.setStyle("top", 30);
        box.setStyle("bottom", 10);
        addChild(box);

        RichTextEditor ed = new RichTextEditor();

        ed.percentWidth  = 100;
        ed.percentHeight = 100;
        box.addChild(ed);

        ed = new RichTextEditor();
        ed.percentWidth  = 100;
        ed.percentHeight = 100;
        box.addChild(ed);

        Button btn = ed.boldButton;

        Avm.Class klass = btn.getStyle("icon") as Avm.Class;
        if (klass != null)
        {
            BitmapAsset bmp = avm.CreateInstance(klass) as BitmapAsset;
            if (bmp != null)
            {
                if (bmp.bitmapData == null)
                {
                    Alert.show("Bad bitmapData");
                    return;
                }

                Sprite   sprite = new Sprite();
                Graphics g      = sprite.graphics;
                g.beginBitmapFill(bmp.bitmapData);
                g.drawRect(0, 0, 16, 16);
                g.endFill();
                addChild(sprite);
            }
            else
            {
                Alert.show("Icon class is not BitmapAsset");
            }
        }
    }