[NUI][AT-SPI] Add indexable AccessibilitySuppressedEvents
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Samples / Tizen.NUI.Samples / Samples / AtspiSample.cs
1 
2 using System;
3 using Tizen.NUI.BaseComponents;
4
5 namespace Tizen.NUI.Samples
6 {
7     public class AtspiSample : IExample
8     {
9         public void Activate()
10         {
11             Window window = NUIApplication.GetDefaultWindow();
12             window.BackgroundColor = Color.White;
13
14             TextLabel text = new TextLabel("PASS");
15             text.HorizontalAlignment = HorizontalAlignment.Center;
16             text.VerticalAlignment = VerticalAlignment.Center;
17             text.TextColor = Color.Blue;
18             text.PointSize = 12.0f;
19             text.HeightResizePolicy = ResizePolicyType.FillToParent;
20             text.WidthResizePolicy = ResizePolicyType.FillToParent;
21             window.Add(text);
22
23             if (text.AccessibilitySuppressedEvents[AccessibilityEvent.MovedOut])
24             {
25                 text.Text = "FAIL";
26                 Tizen.Log.Error("NUITEST", "Default value shoud be false\n");
27                 return;
28             }
29
30             text.AccessibilitySuppressedEvents[AccessibilityEvent.MovedOut] = true;
31             if (!text.AccessibilitySuppressedEvents[AccessibilityEvent.MovedOut])
32             {
33                 text.Text = "FAIL";
34                 Tizen.Log.Error("NUITEST", "Cannot set to true\n");
35                 return;
36             }
37
38             text.AccessibilitySuppressedEvents[AccessibilityEvent.MovedOut] = false;
39             if (text.AccessibilitySuppressedEvents[AccessibilityEvent.MovedOut])
40             {
41                 text.Text = "FAIL";
42                 Tizen.Log.Error("NUITEST", "Cannot set to false\n");
43                 return;
44             }
45         }
46
47         public void Deactivate()
48         {
49         }
50     }
51 }