2 using System.Collections.Generic;
4 using Tizen.NUI.BaseComponents;
5 using Tizen.NUI.UIComponents;
7 namespace TizenVDUIApplication19
11 internal class Program : NUIApplication
13 private Timer myTimer;
14 private List<View> myViewList;
15 private const int numberOfObjects = 500;
16 private Random myRandom;
17 private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res";
19 protected override void OnCreate()
23 Window.Instance.BackgroundColor = Color.White;
25 myViewList = new List<View>();
27 myRandom = new Random();
29 for (int i = 0; i < numberOfObjects; i++)
33 float intensity = myRandom.Next(0, 255) / 255.0f;
34 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
35 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
36 v.PivotPoint = PivotPoint.TopLeft;
37 v.Size2D = new Size2D(100, 100);
41 Window.Instance.GetDefaultLayer().Add(v);
44 myTimer = new Timer(1000);
46 myTimer.Tick += MyTimer_Tick;
51 private bool MyTimer_Tick(object source, System.EventArgs e)
53 //Remove current Scene,
54 foreach (View v in myViewList)
56 Window.Instance.GetDefaultLayer().Remove(v);
64 GC.WaitForPendingFinalizers();
66 for (int i = 0; i < 50; i++)
68 TextLabel v = new TextLabel();
70 float intensity = myRandom.Next(0, 255) / 255.0f;
71 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
72 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
73 v.PivotPoint = PivotPoint.TopLeft;
74 v.Size2D = new Size2D(100, 100);
75 v.Text = "label " + i;
79 Window.Instance.GetDefaultLayer().Add(v);
82 for (int i = 50; i < 100; i++)
84 PushButton v = new PushButton();
86 float intensity = myRandom.Next(0, 255) / 255.0f;
87 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
88 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
89 v.PivotPoint = PivotPoint.TopLeft;
90 v.Size2D = new Size2D(100, 100);
91 v.LabelText = "button " + i;
95 Window.Instance.GetDefaultLayer().Add(v);
98 for (int i = 100; i < 150; i++)
100 ImageView v = new ImageView();
102 float intensity = myRandom.Next(0, 255) / 255.0f;
103 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
104 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
105 v.PivotPoint = PivotPoint.TopLeft;
106 v.Size2D = new Size2D(100, 100);
107 v.ResourceUrl = resources + "/images/gallery-3.jpg";
111 Window.Instance.GetDefaultLayer().Add(v);
114 for (int i = 150; i < 200; i++)
116 TextEditor v = new TextEditor();
118 float intensity = myRandom.Next(0, 255) / 255.0f;
119 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
120 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
121 v.PivotPoint = PivotPoint.TopLeft;
122 v.Size2D = new Size2D(100, 100);
123 v.Text = "editor" + i;
127 Window.Instance.GetDefaultLayer().Add(v);
130 for (int i = 200; i < 250; i++)
132 TextField v = new TextField();
134 float intensity = myRandom.Next(0, 255) / 255.0f;
135 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
136 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
137 v.PivotPoint = PivotPoint.TopLeft;
138 v.Size2D = new Size2D(100, 100);
139 v.Text = "field " + i;
143 Window.Instance.GetDefaultLayer().Add(v);
146 for (int i = 250; i < 300; i++)
148 CheckBoxButton v = new CheckBoxButton();
150 float intensity = myRandom.Next(0, 255) / 255.0f;
151 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
152 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
153 v.PivotPoint = PivotPoint.TopLeft;
154 v.Size2D = new Size2D(100, 100);
155 v.LabelText = "check " + i;
159 Window.Instance.GetDefaultLayer().Add(v);
162 for (int i = 300; i < 350; i++)
164 ScrollBar v = new ScrollBar();
166 float intensity = myRandom.Next(0, 255) / 255.0f;
167 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
168 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
169 v.PivotPoint = PivotPoint.TopLeft;
170 v.Size2D = new Size2D(100, 100);
174 Window.Instance.GetDefaultLayer().Add(v);
177 for (int i = 350; i < 400; i++)
179 Slider v = new Slider();
181 float intensity = myRandom.Next(0, 255) / 255.0f;
182 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
183 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
184 v.PivotPoint = PivotPoint.TopLeft;
185 v.Size2D = new Size2D(100, 100);
189 Window.Instance.GetDefaultLayer().Add(v);
192 for (int i = 400; i < 450; i++)
194 TableView v = new TableView(1, 1);
196 float intensity = myRandom.Next(0, 255) / 255.0f;
197 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
198 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
199 v.PivotPoint = PivotPoint.TopLeft;
200 v.Size2D = new Size2D(100, 100);
204 Window.Instance.GetDefaultLayer().Add(v);
207 for (int i = 450; i < numberOfObjects; i++)
211 float intensity = myRandom.Next(0, 255) / 255.0f;
212 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
213 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
214 v.PivotPoint = PivotPoint.TopLeft;
215 v.Size2D = new Size2D(100, 100);
219 Window.Instance.GetDefaultLayer().Add(v);
225 protected override void OnPause()
227 //This function is called when the window's visibility is changed from visible to invisible.
231 protected override void OnResume()
233 //This function is called when the window's visibility is changed from invisible to visible.
237 protected override void OnTerminate()
239 //This function is called when the app exit normally.
243 protected override void OnLowMemory(LowMemoryEventArgs e)
245 //This function is called when the system is low on memory.
248 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
250 //This function is called when the language is changed.
251 base.OnLocaleChanged(e);
254 private static void _Main(string[] args)
256 //Create an Application
257 Program myProgram = new Program();