Merge "Remove batching." into devel/master
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / examples / dali-test.cs
index b6396f7..274b97a 100644 (file)
@@ -37,11 +37,12 @@ namespace MyCSharpExample
       Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
     }
 
-    public void Initialize(object source, AUIApplicationInitEventArgs e)
+    public void Initialize(object source, NUIApplicationInitEventArgs e)
     {
-
       OperatorTests();
 
+      CustomViewPropertyTest();
+
       Handle handle = new Handle();
       int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
       float myProperty = 0.0f;
@@ -58,7 +59,7 @@ namespace MyCSharpExample
       actor.Name = "MyActor";
       actor.Color = new Color(1.0f, 0.0f, 1.0f, 0.8f);
       Console.WriteLine("Actor id: {0}", actor.GetId());
-      Console.WriteLine("Actor size: " + actor.Size.x + ", " + actor.Size.y);
+      Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
       Console.WriteLine("Actor name: " + actor.Name);
 
       Stage stage = Stage.GetCurrent();
@@ -338,6 +339,52 @@ namespace MyCSharpExample
 
   }
 
+    public void CustomViewPropertyTest()
+    {
+        // Create a Spin control
+        Spin spin = new Spin();
+
+        // Background property
+        Property.Map background = new Property.Map();
+        background.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Color) )
+                  .Add( Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red) );
+        spin.Background = background;
+
+        background = spin.Background;
+        Vector4 backgroundColor = new Vector4();
+        background.Find(Dali.Constants.ColorVisualProperty.MixColor).Get(backgroundColor);
+        if( backgroundColor == Color.Red )
+        {
+            Console.WriteLine ("Custom View Background property : test passed");
+        }
+        else
+        {
+            Console.WriteLine ("Custom View Background property : test failed");
+        }
+
+        // BackgroundColor property
+        spin.BackgroundColor = Color.Yellow;
+        if(spin.BackgroundColor == Color.Yellow)
+        {
+            Console.WriteLine ("Custom View BackgroundColor property : test passed");
+        }
+        else
+        {
+            Console.WriteLine ("Custom View BackgroundColor property : test failed");
+        }
+
+        // StyleName property
+        spin.StyleName = "MyCustomStyle";
+        if(spin.StyleName == "MyCustomStyle")
+        {
+            Console.WriteLine ("Custom View StyleName property : test passed");
+        }
+        else
+        {
+            Console.WriteLine ("Custom View StyleName property : test failed");
+        }
+    }
+
     public void MainLoop()
     {
       _application.MainLoop ();