dali-swig in ubuntu crash fix
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / examples / dali-test.cs
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.Runtime.InteropServices;
20 using Dali;
21
22 namespace MyCSharpExample
23 {
24     class MyView : View
25     {
26         private string _myOwnName;
27         public int _myCurrentValue;
28
29         public MyView()
30         {
31             _myCurrentValue = 0;
32         }
33
34         public string MyOwnName
35         {
36             get
37             {
38                 return _myOwnName;
39             }
40             set
41             {
42                 _myOwnName = value;
43             }
44         }
45     }
46
47     class MyButton : PushButton
48     {
49         private string _myOwnName;
50         public int _myCurrentValue;
51
52         public MyButton()
53         {
54             _myCurrentValue = 0;
55         }
56
57         public string MyOwnName
58         {
59             get
60             {
61                 return _myOwnName;
62             }
63             set
64             {
65                 _myOwnName = value;
66             }
67         }
68     }
69
70     class MySpin : Spin
71     {
72         private string _myOwnName;
73         public int _myCurrentValue;
74
75         public MySpin()
76         {
77             _myCurrentValue = 0;
78         }
79
80         public string MyOwnName
81         {
82             get
83             {
84                 return _myOwnName;
85             }
86             set
87             {
88                 _myOwnName = value;
89             }
90         }
91     }
92
93     class Example
94     {
95         private Dali.Application _application;
96
97         public Example(Dali.Application application)
98         {
99             _application = application;
100             Console.WriteLine("1) InitSignal connection count = " + _application.InitSignal().GetConnectionCount());
101
102             _application.Initialized += Initialize;
103             Console.WriteLine("2) InitSignal connection count = " + _application.InitSignal().GetConnectionCount());
104         }
105
106         public void Initialize(object source, NUIApplicationInitEventArgs e)
107         {
108             //1)
109             NavigationPropertiesTests();
110
111             //2)
112             OperatorTests();
113
114             //3)
115             CustomViewPropertyTest();
116
117             //4)
118             ActorHandleTest();
119
120             //5)
121             RectanglePaddingClassTest();
122
123             //6)
124             SizePositionTest();
125
126             //7)
127             ViewDownCastTest();
128         }
129
130
131         public void NavigationPropertiesTests()
132         {
133             Console.WriteLine("");
134             Console.WriteLine("### [1] NavigationPropertiesTests START");
135
136             View view = new View();
137             View leftView, rightView, upView, downView, tmpView;
138
139             leftView = new View();
140             leftView.Name = "leftView";
141             rightView = new View();
142             rightView.Name = "rightView";
143             upView = new View();
144             upView.Name = "upView";
145             downView = new View();
146             downView.Name = "downView";
147
148             Stage.Instance.Add(leftView);
149             Stage.Instance.Add(rightView);
150             Stage.Instance.Add(upView);
151             Stage.Instance.Add(downView);
152
153             view.LeftFocusableView = leftView;
154             tmpView = view.LeftFocusableView;
155             if (string.Compare(tmpView.Name, "leftView") == 0)
156             {
157                 Console.WriteLine("Passed: LeftFocusedView = " + tmpView.Name);
158             }
159             else
160             {
161                 Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
162             }
163
164             view.RightFocusableView = rightView;
165             tmpView = view.RightFocusableView;
166             if (string.Compare(tmpView.Name, "rightView") == 0)
167             {
168                 Console.WriteLine("Passed: RightFocusedView = " + tmpView.Name);
169             }
170             else
171             {
172                 Console.WriteLine("Failed: RightFocusedView = " + tmpView.Name);
173             }
174
175             Stage.Instance.Add(view);
176
177             view.UpFocusableView = upView;
178             tmpView = view.UpFocusableView;
179             if (string.Compare(tmpView.Name, "upView") == 0)
180             {
181                 Console.WriteLine("Passed: UpFocusedView = " + tmpView.Name);
182             }
183             else
184             {
185                 Console.WriteLine("Failed: UpFocusedView = " + tmpView.Name);
186             }
187
188             view.DownFocusableView = downView;
189             tmpView = view.DownFocusableView;
190             if (string.Compare(tmpView.Name, "downView") == 0)
191             {
192                 Console.WriteLine("Passed: DownFocusedView = " + tmpView.Name);
193             }
194             else
195             {
196                 Console.WriteLine("Failed: DownFocusedView = " + tmpView.Name);
197             }
198
199             Stage.Instance.Remove(leftView);
200             tmpView = view.LeftFocusableView;
201             if (!tmpView)
202             {
203                 Console.WriteLine("Passed: NULL LeftFocusedView");
204             }
205             else
206             {
207                 Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
208             }
209
210             Console.WriteLine("### [1] NavigationPropertiesTests END");
211         }
212
213         public void OperatorTests()
214         {
215             Console.WriteLine("");
216             Console.WriteLine("### [2] OperatorTests START");
217             Actor actor = new Actor();
218             Actor differentActor = new Actor();
219             Actor actorSame = actor;
220             Actor nullActor = null;
221
222             // test the true operator
223             if (actor)
224             {
225                 Console.WriteLine("BaseHandle Operator true (actor) : test passed ");
226             }
227             else
228             {
229                 Console.WriteLine("BaseHandle Operator true (actor): test failed ");
230             }
231
232             Actor parent = actor.GetParent();
233
234             if (parent)
235             {
236                 Console.WriteLine("Handle with Empty body  :failed ");
237             }
238             else
239             {
240                 Console.WriteLine("Valid with Empty body  :passed ");
241             }
242
243             actor.Add(differentActor);
244
245             // here we test two different C# objects, which on the native side have the same body/ ref-object
246             if (actor == differentActor.GetParent())
247             {
248                 Console.WriteLine("actor == differentActor.GetParent() :passed ");
249             }
250             else
251             {
252                 Console.WriteLine("actor == differentActor.GetParent() :failed ");
253             }
254
255             if (differentActor == differentActor.GetParent())
256             {
257                 Console.WriteLine("differentActor == differentActor.GetParent() :failed ");
258             }
259             else
260             {
261                 Console.WriteLine("differentActor == differentActor.GetParent() :passed ");
262             }
263
264             if (nullActor)
265             {
266                 Console.WriteLine("BaseHandle Operator true (nullActor) : test failed ");
267             }
268             else
269             {
270                 Console.WriteLine("BaseHandle Operator true (nullActor): test passed ");
271             }
272
273             // ! operator
274             if (!actor)
275             {
276                 Console.WriteLine("BaseHandle Operator !(actor) : test failed ");
277             }
278             else
279             {
280                 Console.WriteLine("BaseHandle Operator !(actor): test passed ");
281             }
282
283             if (!nullActor)
284             {
285                 Console.WriteLine("BaseHandle Operator !(nullActor) : test passed ");
286             }
287             else
288             {
289                 Console.WriteLine("BaseHandle Operator !(nullActor): test failed ");
290             }
291
292             // Note: operator false only used inside & operator
293             // test equality operator ==
294             if (actor == actorSame)
295             {
296                 Console.WriteLine("BaseHandle Operator  (actor == actorSame) : test passed");
297             }
298             else
299             {
300                 Console.WriteLine("BaseHandle Operator  (actor == actorSame) : test failed");
301             }
302
303             if (actor == differentActor)
304             {
305                 Console.WriteLine("BaseHandle Operator (actor == differentActor) : test failed");
306             }
307             else
308             {
309                 Console.WriteLine("BaseHandle Operator (actor == differentActor) : test passed");
310             }
311
312             if (actor == nullActor)
313             {
314                 Console.WriteLine("BaseHandle Operator (actor == nullActor) : test failed");
315             }
316             else
317             {
318                 Console.WriteLine("BaseHandle Operator (actor == nullActor) : test passed");
319             }
320
321             if (nullActor == nullActor)
322             {
323                 Console.WriteLine("BaseHandle Operator (nullActor == nullActor) : test passed");
324             }
325             else
326             {
327                 Console.WriteLine("BaseHandle Operator (nullActor == nullActor) : test failed");
328             }
329
330             // test || operator
331             if (actor || actorSame)
332             {
333                 Console.WriteLine("BaseHandle Operator (actor || actorSame) : test passed");
334             }
335             else
336             {
337                 Console.WriteLine("BaseHandle Operator (actor || actorSame) : test failed");
338             }
339
340             if (actor || nullActor)
341             {
342                 Console.WriteLine("BaseHandle Operator (actor || nullActor) : test passed");
343             }
344             else
345             {
346                 Console.WriteLine("BaseHandle Operator (actor || nullActor) : test failed");
347             }
348
349             if (nullActor || nullActor)
350             {
351                 Console.WriteLine("BaseHandle Operator (nullActor || nullActor) : test failed");
352             }
353             else
354             {
355                 Console.WriteLine("BaseHandle Operator (nullActor || nullActor) : test passed");
356             }
357
358             // test && operator
359             if (actor && actorSame)
360             {
361                 Console.WriteLine("BaseHandle Operator (actor && actorSame) : test passed");
362             }
363             else
364             {
365                 Console.WriteLine("BaseHandle Operator (actor && actorSame) : test failed");
366             }
367
368             if (actor && nullActor)
369             {
370                 Console.WriteLine("BaseHandle Operator (actor && nullActor) : test failed");
371             }
372             else
373             {
374                 Console.WriteLine("BaseHandle Operator (actor && nullActor) : test passed");
375             }
376
377             if (nullActor && nullActor)
378             {
379                 Console.WriteLine("BaseHandle Operator (nullActor && nullActor) : test failed");
380             }
381             else
382             {
383                 Console.WriteLine("BaseHandle Operator (nullActor && nullActor) : test passed");
384             }
385
386             Console.WriteLine("### [2] OperatorTests END");
387
388         }
389
390         public void CustomViewPropertyTest()
391         {
392             Console.WriteLine("");
393             Console.WriteLine("### [3] CustomViewPropertyTest START");
394
395             // Create a Spin control
396             Spin spin = new Spin();
397
398             // Background property
399             Property.Map background = new Property.Map();
400             background.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Color))
401                       .Add(Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red));
402             spin.Background = background;
403
404             background = spin.Background;
405             Vector4 backgroundColor = new Vector4();
406             background.Find(Dali.Constants.ColorVisualProperty.MixColor).Get(backgroundColor);
407             if (backgroundColor == Color.Red)
408             {
409                 Console.WriteLine("Custom View Background property : test passed");
410             }
411             else
412             {
413                 Console.WriteLine("Custom View Background property : test failed");
414             }
415
416             // BackgroundColor property
417             spin.BackgroundColor = Color.Yellow;
418             if (spin.BackgroundColor == Color.Yellow)
419             {
420                 Console.WriteLine("Custom View BackgroundColor property : test passed");
421             }
422             else
423             {
424                 Console.WriteLine("Custom View BackgroundColor property : test failed");
425             }
426
427             // BackgroundImage property
428             spin.BackgroundImage = "background-image.jpg";
429             if (spin.BackgroundImage == "background-image.jpg")
430             {
431                 Console.WriteLine("Custom View BackgroundImage property : test passed");
432             }
433             else
434             {
435                 Console.WriteLine("Custom View BackgroundImage property : test failed");
436             }
437
438             // StyleName property
439             spin.StyleName = "MyCustomStyle";
440             if (spin.StyleName == "MyCustomStyle")
441             {
442                 Console.WriteLine("Custom View StyleName property : test passed");
443             }
444             else
445             {
446                 Console.WriteLine("Custom View StyleName property : test failed");
447             }
448
449             Console.WriteLine("### [3] CustomViewPropertyTest END");
450         }
451
452
453
454         public void ActorHandleTest()
455         {
456             Console.WriteLine("");
457             Console.WriteLine("### [4] ActorHandleTest START");
458
459             Handle handle = new Handle();
460             int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
461             float myProperty = 0.0f;
462             handle.GetProperty(myPropertyIndex).Get(ref myProperty);
463             Console.WriteLine("myProperty value: " + myProperty);
464
465             int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Size(5.0f, 5.0f)), Property.AccessMode.READ_WRITE);
466             Size myProperty2 = new Size(0.0f, 0.0f);
467             handle.GetProperty(myPropertyIndex2).Get(myProperty2);
468             Console.WriteLine("myProperty2 value: " + myProperty2.W + ", " + myProperty2.H);
469
470             Actor actor = new Actor();
471             actor.Size = new Position(200.0f, 200.0f, 0.0f);
472             actor.Name = "MyActor";
473             Console.WriteLine("Actor id: {0}", actor.GetId());
474             Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
475             Console.WriteLine("Actor name: " + actor.Name);
476
477             Stage stage = Stage.GetCurrent();
478             stage.BackgroundColor = Color.White;
479             Size stageSize = stage.Size;
480             Console.WriteLine("Stage size: " + stageSize.W + ", " + stageSize.H);
481             stage.Add(actor);
482
483             TextLabel text = new TextLabel("Hello World");
484             text.ParentOrigin = NDalic.ParentOriginCenter;
485             text.AnchorPoint = NDalic.AnchorPointCenter;
486             text.HorizontalAlignment = "CENTER";
487             stage.Add(text);
488
489             Console.WriteLine("Text label text:  " + text.Text);
490
491             Console.WriteLine("Text label point size:  " + text.PointSize);
492             text.PointSize = 32.0f;
493             Console.WriteLine("Text label new point size:  " + text.PointSize);
494
495             Console.WriteLine("### [4] ActorHandleTest END");
496
497         }
498
499
500
501         public void RectanglePaddingClassTest()
502         {
503             Console.WriteLine("");
504             Console.WriteLine("### [5] RectanglePaddingClassTest START");
505
506             using (Rectangle r1 = new Rectangle(2, 5, 20, 30))
507             {
508                 Console.WriteLine("    Created " + r1);
509                 Console.WriteLine("    IsEmpty() =  " + r1.IsEmpty());
510                 Console.WriteLine("    Left =  " + r1.Left());
511                 Console.WriteLine("    Right =  " + r1.Right());
512                 Console.WriteLine("    Top  = " + r1.Top());
513                 Console.WriteLine("    Bottom  = " + r1.Bottom());
514                 Console.WriteLine("    Area  = " + r1.Area());
515             }
516
517             Console.WriteLine(" *************************");
518
519             using (Rectangle r2 = new Rectangle(2, 5, 20, 30))
520             {
521                 Console.WriteLine("    Created " + r2);
522                 r2.Set(1, 1, 40, 40);
523                 Console.WriteLine("    IsEmpty() =  " + r2.IsEmpty());
524                 Console.WriteLine("    Left =  " + r2.Left());
525                 Console.WriteLine("    Right =  " + r2.Right());
526                 Console.WriteLine("    Top  = " + r2.Top());
527                 Console.WriteLine("    Bottom  = " + r2.Bottom());
528                 Console.WriteLine("    Area  = " + r2.Area());
529             }
530
531             Console.WriteLine(" *************************");
532
533             Rectangle r3 = new Rectangle(10, 10, 20, 20);
534             Rectangle r4 = new Rectangle(10, 10, 20, 20);
535
536             if (r3 == r4)
537             {
538                 Console.WriteLine("r3 == r4");
539             }
540             else
541             {
542                 Console.WriteLine("r3 != r4");
543             }
544
545             r4 = new Rectangle(12, 10, 20, 20);
546
547             if (r3 == r4)
548             {
549                 Console.WriteLine("r3 == r4");
550             }
551             else
552             {
553                 Console.WriteLine("r3 != r4");
554             }
555
556             PaddingType p1 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
557             PaddingType p2 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
558
559             if (p1 == p2)
560             {
561                 Console.WriteLine("p1 == p2");
562             }
563             else
564             {
565                 Console.WriteLine("p1 != p2");
566             }
567
568             p2 = new PaddingType(12.0f, 10.7f, 20.2f, 20.0f);
569
570             if (p1 == p2)
571             {
572                 Console.WriteLine("p1 == p2");
573             }
574             else
575             {
576                 Console.WriteLine("p1 != p2");
577             }
578             Console.WriteLine("### [5] RectanglePaddingClassTest END");
579
580         }
581
582
583         public void SizePositionTest()
584         {
585             Console.WriteLine("");
586             Console.WriteLine("### [6] SizePositionTest START");
587
588             Size Size = new Size(100, 50);
589             Console.WriteLine("    Created " + Size);
590             Console.WriteLine("    Size x =  " + Size.W + ", y = " + Size.H);
591             Size += new Size(20, 20);
592             Console.WriteLine("    Size x =  " + Size.W + ", y = " + Size.H);
593             Size.W += 10;
594             Size.H += 10;
595             Console.WriteLine("    Size width =  " + Size.W + ", height = " + Size.H);
596
597             Console.WriteLine(" *************************");
598             Position Position = new Position(20, 100, 50);
599             Console.WriteLine("    Created " + Position);
600             Console.WriteLine("    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z);
601             Position += new Position(20, 20, 20);
602             Console.WriteLine("    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z);
603             Position.X += 10;
604             Position.Y += 10;
605             Position.Z += 10;
606             Console.WriteLine("    Position width =  " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z);
607             Position parentOrigin = new Dali.Position(NDalic.ParentOriginBottomRight);
608             Console.WriteLine("    parentOrigin x =  " + parentOrigin.X + ", y = " + parentOrigin.Y + ", z = " + parentOrigin.Z);
609
610             Console.WriteLine(" *************************");
611             Color color = new Color(20, 100, 50, 200);
612             Console.WriteLine("    Created " + color);
613             Console.WriteLine("    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A);
614             color += new Color(20, 20, 20, 20);
615             Console.WriteLine("    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A);
616             color.R += 10;
617             color.G += 10;
618             color.B += 10;
619             color.A += 10;
620             Console.WriteLine("    Color r =  " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A);
621
622             Console.WriteLine("### [6] SizePositionTest END");
623         }
624
625
626         public void ViewDownCastTest()
627         {
628             Console.WriteLine("");
629             Console.WriteLine("### [7] ViewDownCastTest START");
630
631             View container = new View();
632             container.Position = new Position(-800.0f, -800.0f, 0.0f);
633             Stage.GetCurrent().Add(container);
634
635             // Test downcast for native control
636             TextLabel myLabel = new TextLabel();
637             myLabel.Name = "MyLabelName";
638             myLabel.Text = "MyText";
639
640             Console.WriteLine("myLabel.Name = " + myLabel.Name + ", Text = " + myLabel.Text);
641
642             container.Add(myLabel);
643
644             Actor myLabelActor = container.FindChildByName("MyLabelName");
645             if (myLabelActor)
646             {
647                 TextLabel newLabel = View.DownCast<TextLabel>(myLabelActor);
648                 if (newLabel)
649                 {
650                     Console.WriteLine("Downcast to TextLabel successful: newLabel Name = " + newLabel.Name + ", Text = " + newLabel.Text);
651                 }
652                 else
653                 {
654                     Console.WriteLine("Downcast to TextLabel failed!");
655                 }
656             }
657
658             // Test downcast for class directly inherited from View
659             MyView myView = new MyView();
660             myView.Name = "MyViewName";
661             myView.MyOwnName = "MyOwnViewName";
662             myView._myCurrentValue = 5;
663
664             Console.WriteLine("myView.Name = " + myView.Name + ", MyOwnName = " + myView.MyOwnName + ", myCurrentValue = " + myView._myCurrentValue);
665
666             container.Add(myView);
667
668             Actor myViewActor = container.FindChildByName("MyViewName");
669             if (myViewActor)
670             {
671                 MyView newView = View.DownCast<MyView>(myViewActor);
672                 if (newView)
673                 {
674                     Console.WriteLine("Downcast to MyView successful: newView Name = " + newView.Name + ", MyOwnName = " + newView.MyOwnName + ", myCurrentValue = " + newView._myCurrentValue);
675                 }
676                 else
677                 {
678                     Console.WriteLine("Downcast to MyView failed!");
679                 }
680             }
681
682             // Test downcast for class directly inherited from native control
683             MyButton myButton = new MyButton();
684             myButton.Name = "MyButtonName";
685             myButton.MyOwnName = "MyOwnViewName";
686             myButton.LabelText = "MyLabelText";
687             myButton._myCurrentValue = 5;
688
689             Console.WriteLine("myButton.Name = " + myButton.Name + ", MyOwnName = " + myButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + myButton._myCurrentValue);
690
691             container.Add(myButton);
692
693             Actor myButtonActor = container.FindChildByName("MyButtonName");
694             if (myButtonActor)
695             {
696                 MyButton newButton = View.DownCast<MyButton>(myButtonActor);
697                 if (newButton)
698                 {
699                     Console.WriteLine("Downcast to MyButton successful: newButton Name = " + newButton.Name + ", MyOwnName = " + newButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + newButton._myCurrentValue);
700                 }
701                 else
702                 {
703                     Console.WriteLine("Downcast to MyButton failed!");
704                 }
705             }
706
707             // Test downcast for a CustomView
708             Spin spin = new Spin();
709             spin.Name = "SpinName";
710             spin.MaxValue = 8888;
711
712             Console.WriteLine("spin.Name = " + spin.Name + ", MaxValue = " + spin.MaxValue);
713
714             container.Add(spin);
715
716             Actor spinActor = container.FindChildByName("SpinName");
717             if (spinActor)
718             {
719                 Spin newSpin = View.DownCast<Spin>(spinActor);
720                 if (newSpin)
721                 {
722                     Console.WriteLine("Downcast to Spin successful: newSpin Name = " + newSpin.Name + ", MaxValue = " + newSpin.MaxValue);
723                 }
724                 else
725                 {
726                     Console.WriteLine("Downcast to Spin failed!");
727                 }
728             }
729
730             // Test downcast for class inherited from a CustomView
731             MySpin mySpin = new MySpin();
732             mySpin.Name = "MySpinName";
733             mySpin.MyOwnName = "MyOwnSpinName";
734             mySpin.MaxValue = 8888;
735             mySpin._myCurrentValue = 5;
736
737             Console.WriteLine("mySpin.Name = " + mySpin.Name + ", MyOwnName = " + mySpin.MyOwnName + ", MaxValue = " + mySpin.MaxValue + ", currentValue = " + mySpin._myCurrentValue);
738
739             container.Add(mySpin);
740
741             Actor mySpinActor = container.FindChildByName("MySpinName");
742             if (mySpinActor)
743             {
744                 MySpin newSpin = View.DownCast<MySpin>(mySpinActor);
745                 if (newSpin)
746                 {
747                     Console.WriteLine("Downcast to MySpin successful: newSpin Name = " + newSpin.Name + ", MyOwnName = " + newSpin.MyOwnName + ", MaxValue = " + newSpin.MaxValue + ", currentValue = " + newSpin._myCurrentValue);
748                 }
749                 else
750                 {
751                     Console.WriteLine("Downcast to MySpin failed!");
752                 }
753             }
754
755             Console.WriteLine("### [7] ViewDownCastTest END");
756         }
757
758         public void MainLoop()
759         {
760             _application.MainLoop();
761         }
762
763         /// <summary>
764         /// The main entry point for the application.
765         /// </summary>
766         [STAThread]
767         static void Main(string[] args)
768         {
769             Console.WriteLine("Hello World");
770
771             Example example = new Example(Application.NewApplication());
772             example.MainLoop();
773         }
774     }
775 }
776
777