2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.Runtime.InteropServices;
22 namespace MyCSharpExample
26 private string _myOwnName;
27 public int _myCurrentValue;
34 public string MyOwnName
47 class MyButton : PushButton
49 private string _myOwnName;
50 public int _myCurrentValue;
57 public string MyOwnName
72 private string _myOwnName;
73 public int _myCurrentValue;
80 public string MyOwnName
95 private Dali.Application _application;
97 public Example(Dali.Application application)
99 _application = application;
100 Console.WriteLine("1) InitSignal connection count = " + _application.InitSignal().GetConnectionCount());
102 _application.Initialized += Initialize;
103 Console.WriteLine("2) InitSignal connection count = " + _application.InitSignal().GetConnectionCount());
106 public void Initialize(object source, NUIApplicationInitEventArgs e)
110 NavigationPropertiesTests();
116 CustomViewPropertyTest();
122 RectanglePaddingClassTest();
133 public void NavigationPropertiesTests()
135 Console.WriteLine("");
136 Console.WriteLine("### [1] NavigationPropertiesTests START");
138 View view = new View();
139 View leftView, rightView, upView, downView, tmpView;
141 leftView = new View();
142 leftView.Name = "leftView";
143 rightView = new View();
144 rightView.Name = "rightView";
146 upView.Name = "upView";
147 downView = new View();
148 downView.Name = "downView";
150 Stage.Instance.Add(leftView);
151 Stage.Instance.Add(rightView);
152 Stage.Instance.Add(upView);
153 Stage.Instance.Add(downView);
155 view.LeftFocusableView = leftView;
156 tmpView = view.LeftFocusableView;
157 if (string.Compare(tmpView.Name, "leftView") == 0)
159 Console.WriteLine("Passed: LeftFocusedView = " + tmpView.Name);
163 Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
166 view.RightFocusableView = rightView;
167 tmpView = view.RightFocusableView;
168 if (string.Compare(tmpView.Name, "rightView") == 0)
170 Console.WriteLine("Passed: RightFocusedView = " + tmpView.Name);
174 Console.WriteLine("Failed: RightFocusedView = " + tmpView.Name);
177 Stage.Instance.Add(view);
179 view.UpFocusableView = upView;
180 tmpView = view.UpFocusableView;
181 if (string.Compare(tmpView.Name, "upView") == 0)
183 Console.WriteLine("Passed: UpFocusedView = " + tmpView.Name);
187 Console.WriteLine("Failed: UpFocusedView = " + tmpView.Name);
190 view.DownFocusableView = downView;
191 tmpView = view.DownFocusableView;
192 if (string.Compare(tmpView.Name, "downView") == 0)
194 Console.WriteLine("Passed: DownFocusedView = " + tmpView.Name);
198 Console.WriteLine("Failed: DownFocusedView = " + tmpView.Name);
201 Stage.Instance.Remove(leftView);
202 tmpView = view.LeftFocusableView;
205 Console.WriteLine("Passed: NULL LeftFocusedView");
209 Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
212 Console.WriteLine("### [1] NavigationPropertiesTests END");
215 public void OperatorTests()
217 Console.WriteLine("");
218 Console.WriteLine("### [2] OperatorTests START");
219 Actor actor = new Actor();
220 Actor differentActor = new Actor();
221 Actor actorSame = actor;
222 Actor nullActor = null;
224 // test the true operator
227 Console.WriteLine("BaseHandle Operator true (actor) : test passed ");
231 Console.WriteLine("BaseHandle Operator true (actor): test failed ");
234 Actor parent = actor.GetParent();
238 Console.WriteLine("Handle with Empty body :failed ");
242 Console.WriteLine("Valid with Empty body :passed ");
245 actor.Add(differentActor);
247 // here we test two different C# objects, which on the native side have the same body/ ref-object
248 if (actor == differentActor.GetParent())
250 Console.WriteLine("actor == differentActor.GetParent() :passed ");
254 Console.WriteLine("actor == differentActor.GetParent() :failed ");
257 if (differentActor == differentActor.GetParent())
259 Console.WriteLine("differentActor == differentActor.GetParent() :failed ");
263 Console.WriteLine("differentActor == differentActor.GetParent() :passed ");
268 Console.WriteLine("BaseHandle Operator true (nullActor) : test failed ");
272 Console.WriteLine("BaseHandle Operator true (nullActor): test passed ");
278 Console.WriteLine("BaseHandle Operator !(actor) : test failed ");
282 Console.WriteLine("BaseHandle Operator !(actor): test passed ");
287 Console.WriteLine("BaseHandle Operator !(nullActor) : test passed ");
291 Console.WriteLine("BaseHandle Operator !(nullActor): test failed ");
294 // Note: operator false only used inside & operator
295 // test equality operator ==
296 if (actor == actorSame)
298 Console.WriteLine("BaseHandle Operator (actor == actorSame) : test passed");
302 Console.WriteLine("BaseHandle Operator (actor == actorSame) : test failed");
305 if (actor == differentActor)
307 Console.WriteLine("BaseHandle Operator (actor == differentActor) : test failed");
311 Console.WriteLine("BaseHandle Operator (actor == differentActor) : test passed");
314 if (actor == nullActor)
316 Console.WriteLine("BaseHandle Operator (actor == nullActor) : test failed");
320 Console.WriteLine("BaseHandle Operator (actor == nullActor) : test passed");
323 if (nullActor == nullActor)
325 Console.WriteLine("BaseHandle Operator (nullActor == nullActor) : test passed");
329 Console.WriteLine("BaseHandle Operator (nullActor == nullActor) : test failed");
333 if (actor || actorSame)
335 Console.WriteLine("BaseHandle Operator (actor || actorSame) : test passed");
339 Console.WriteLine("BaseHandle Operator (actor || actorSame) : test failed");
342 if (actor || nullActor)
344 Console.WriteLine("BaseHandle Operator (actor || nullActor) : test passed");
348 Console.WriteLine("BaseHandle Operator (actor || nullActor) : test failed");
351 if (nullActor || nullActor)
353 Console.WriteLine("BaseHandle Operator (nullActor || nullActor) : test failed");
357 Console.WriteLine("BaseHandle Operator (nullActor || nullActor) : test passed");
361 if (actor && actorSame)
363 Console.WriteLine("BaseHandle Operator (actor && actorSame) : test passed");
367 Console.WriteLine("BaseHandle Operator (actor && actorSame) : test failed");
370 if (actor && nullActor)
372 Console.WriteLine("BaseHandle Operator (actor && nullActor) : test failed");
376 Console.WriteLine("BaseHandle Operator (actor && nullActor) : test passed");
379 if (nullActor && nullActor)
381 Console.WriteLine("BaseHandle Operator (nullActor && nullActor) : test failed");
385 Console.WriteLine("BaseHandle Operator (nullActor && nullActor) : test passed");
388 Console.WriteLine("### [2] OperatorTests END");
392 public void CustomViewPropertyTest()
394 Console.WriteLine("");
395 Console.WriteLine("### [3] CustomViewPropertyTest START");
397 // Create a Spin control
398 Spin spin = new Spin();
400 // Background property
401 Property.Map background = new Property.Map();
402 background.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Color))
403 .Add(Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red));
404 spin.Background = background;
406 background = spin.Background;
407 Color backgroundColor = new Color();
408 background.Find(Dali.Constants.ColorVisualProperty.MixColor).Get(backgroundColor);
410 if (backgroundColor == Color.Red)
412 Console.WriteLine("Custom View Background property : test passed");
416 Console.WriteLine("Custom View Background property : test failed");
419 // BackgroundColor property
420 spin.BackgroundColor = Color.Yellow;
422 if (spin.BackgroundColor.EqualTo(Color.Yellow))
424 Console.WriteLine("Custom View BackgroundColor property : test passed");
428 Console.WriteLine("Custom View BackgroundColor property : test failed");
431 // BackgroundImage property
432 spin.BackgroundImage = "background-image.jpg";
433 if (spin.BackgroundImage == "background-image.jpg")
435 Console.WriteLine("Custom View BackgroundImage property : test passed");
439 Console.WriteLine("Custom View BackgroundImage property : test failed");
442 // StyleName property
443 spin.StyleName = "MyCustomStyle";
444 if (spin.StyleName == "MyCustomStyle")
446 Console.WriteLine("Custom View StyleName property : test passed");
450 Console.WriteLine("Custom View StyleName property : test failed");
453 Console.WriteLine("### [3] CustomViewPropertyTest END");
458 public void ActorHandleTest()
460 Console.WriteLine("");
461 Console.WriteLine("### [4] ActorHandleTest START");
463 Handle handle = new Handle();
464 int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
465 float myProperty = 0.0f;
466 handle.GetProperty(myPropertyIndex).Get(ref myProperty);
467 Console.WriteLine("myProperty value: " + myProperty);
469 int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Size(5.0f, 5.0f, 5.0f)), Property.AccessMode.READ_WRITE);
470 Size myProperty2 = new Size(0.0f, 0.0f, 0.0f);
471 handle.GetProperty(myPropertyIndex2).Get(myProperty2);
472 Console.WriteLine("myProperty2 value: " + myProperty2.Width + ", " + myProperty2.Height);
474 Actor actor = new Actor();
475 actor.Size = new Position(200.0f, 200.0f, 0.0f);
476 actor.Name = "MyActor";
477 Console.WriteLine("Actor id: {0}", actor.GetId());
478 Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
479 Console.WriteLine("Actor name: " + actor.Name);
481 Stage stage = Stage.GetCurrent();
482 stage.BackgroundColor = Color.White;
483 Size2D stageSize = stage.Size;
484 Console.WriteLine("Stage size: " + stageSize.Width + ", " + stageSize.Height);
487 TextLabel text = new TextLabel("Hello World");
488 text.ParentOrigin = NDalic.ParentOriginCenter;
489 text.AnchorPoint = NDalic.AnchorPointCenter;
490 text.HorizontalAlignment = "CENTER";
493 Console.WriteLine("Text label text: " + text.Text);
495 Console.WriteLine("Text label point size: " + text.PointSize);
496 text.PointSize = 32.0f;
497 Console.WriteLine("Text label new point size: " + text.PointSize);
499 Console.WriteLine("### [4] ActorHandleTest END");
505 public void RectanglePaddingClassTest()
507 Console.WriteLine("");
508 Console.WriteLine("### [5] RectanglePaddingClassTest START");
510 using (Rectangle r1 = new Rectangle(2, 5, 20, 30))
512 Console.WriteLine(" Created " + r1);
513 Console.WriteLine(" IsEmpty() = " + r1.IsEmpty());
514 Console.WriteLine(" Left = " + r1.Left());
515 Console.WriteLine(" Right = " + r1.Right());
516 Console.WriteLine(" Top = " + r1.Top());
517 Console.WriteLine(" Bottom = " + r1.Bottom());
518 Console.WriteLine(" Area = " + r1.Area());
521 Console.WriteLine(" *************************");
523 using (Rectangle r2 = new Rectangle(2, 5, 20, 30))
525 Console.WriteLine(" Created " + r2);
526 r2.Set(1, 1, 40, 40);
527 Console.WriteLine(" IsEmpty() = " + r2.IsEmpty());
528 Console.WriteLine(" Left = " + r2.Left());
529 Console.WriteLine(" Right = " + r2.Right());
530 Console.WriteLine(" Top = " + r2.Top());
531 Console.WriteLine(" Bottom = " + r2.Bottom());
532 Console.WriteLine(" Area = " + r2.Area());
535 Console.WriteLine(" *************************");
537 Rectangle r3 = new Rectangle(10, 10, 20, 20);
538 Rectangle r4 = new Rectangle(10, 10, 20, 20);
542 Console.WriteLine("r3 == r4");
546 Console.WriteLine("r3 != r4");
549 r4 = new Rectangle(12, 10, 20, 20);
553 Console.WriteLine("r3 == r4");
557 Console.WriteLine("r3 != r4");
560 PaddingType p1 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
561 PaddingType p2 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
565 Console.WriteLine("p1 == p2");
569 Console.WriteLine("p1 != p2");
572 p2 = new PaddingType(12.0f, 10.7f, 20.2f, 20.0f);
576 Console.WriteLine("p1 == p2");
580 Console.WriteLine("p1 != p2");
582 Console.WriteLine("### [5] RectanglePaddingClassTest END");
587 public void SizePositionTest()
589 Console.WriteLine("");
590 Console.WriteLine("### [6] SizePositionTest START");
592 Size Size = new Size(100, 50, 25);
593 Console.WriteLine(" Created " + Size);
594 Console.WriteLine(" Size w = " + Size.Width + ", h = " + Size.Height + ", d = " + Size.Depth);
595 Size += new Size(20, 20, 20);
596 Console.WriteLine(" Size w = " + Size.Width + ", h = " + Size.Height + ", d = " + Size.Depth);
600 Console.WriteLine(" Size width = " + Size.Width+ ", height = " + Size.Height + ", depth = " + Size.Depth);
602 Console.WriteLine(" *************************");
603 Position Position = new Position(20, 100, 50);
604 Console.WriteLine(" Created " + Position);
605 Console.WriteLine(" Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z);
606 Position += new Position(20, 20, 20);
607 Console.WriteLine(" Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z);
611 Console.WriteLine(" Position width = " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z);
612 Position parentOrigin = ParentOrigin.BottomRight;
613 Console.WriteLine(" parentOrigin x = " + parentOrigin.X + ", y = " + parentOrigin.Y + ", z = " + parentOrigin.Z);
615 Console.WriteLine(" *************************");
616 Color color = new Color(20, 100, 50, 200);
617 Console.WriteLine(" Created " + color);
618 Console.WriteLine(" Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A);
619 color += new Color(20, 20, 20, 20);
620 Console.WriteLine(" Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A);
625 Console.WriteLine(" Color r = " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A);
627 Console.WriteLine("### [6] SizePositionTest END");
631 public void ViewDownCastTest()
633 Console.WriteLine("");
634 Console.WriteLine("### [7] ViewDownCastTest START");
636 View container = new View();
637 container.Position = new Position(-800.0f, -800.0f, 0.0f);
638 Stage.GetCurrent().Add(container);
640 // Test downcast for native control
641 TextLabel myLabel = new TextLabel();
642 myLabel.Name = "MyLabelName";
643 myLabel.Text = "MyText";
645 Console.WriteLine("myLabel.Name = " + myLabel.Name + ", Text = " + myLabel.Text);
647 container.Add(myLabel);
649 Actor myLabelActor = container.FindChildByName("MyLabelName");
652 TextLabel newLabel = View.DownCast<TextLabel>(myLabelActor);
655 Console.WriteLine("Downcast to TextLabel successful: newLabel Name = " + newLabel.Name + ", Text = " + newLabel.Text);
659 Console.WriteLine("Downcast to TextLabel failed!");
663 // Test downcast for class directly inherited from View
664 MyView myView = new MyView();
665 myView.Name = "MyViewName";
666 myView.MyOwnName = "MyOwnViewName";
667 myView._myCurrentValue = 5;
669 Console.WriteLine("myView.Name = " + myView.Name + ", MyOwnName = " + myView.MyOwnName + ", myCurrentValue = " + myView._myCurrentValue);
671 container.Add(myView);
673 Actor myViewActor = container.FindChildByName("MyViewName");
676 MyView newView = View.DownCast<MyView>(myViewActor);
679 Console.WriteLine("Downcast to MyView successful: newView Name = " + newView.Name + ", MyOwnName = " + newView.MyOwnName + ", myCurrentValue = " + newView._myCurrentValue);
683 Console.WriteLine("Downcast to MyView failed!");
687 // Test downcast for class directly inherited from native control
688 MyButton myButton = new MyButton();
689 myButton.Name = "MyButtonName";
690 myButton.MyOwnName = "MyOwnViewName";
691 myButton.LabelText = "MyLabelText";
692 myButton._myCurrentValue = 5;
694 Console.WriteLine("myButton.Name = " + myButton.Name + ", MyOwnName = " + myButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + myButton._myCurrentValue);
696 container.Add(myButton);
698 Actor myButtonActor = container.FindChildByName("MyButtonName");
701 MyButton newButton = View.DownCast<MyButton>(myButtonActor);
704 Console.WriteLine("Downcast to MyButton successful: newButton Name = " + newButton.Name + ", MyOwnName = " + newButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + newButton._myCurrentValue);
708 Console.WriteLine("Downcast to MyButton failed!");
712 // Test downcast for a CustomView
713 Spin spin = new Spin();
714 spin.Name = "SpinName";
715 spin.MaxValue = 8888;
717 Console.WriteLine("spin.Name = " + spin.Name + ", MaxValue = " + spin.MaxValue);
721 Actor spinActor = container.FindChildByName("SpinName");
724 Spin newSpin = View.DownCast<Spin>(spinActor);
727 Console.WriteLine("Downcast to Spin successful: newSpin Name = " + newSpin.Name + ", MaxValue = " + newSpin.MaxValue);
731 Console.WriteLine("Downcast to Spin failed!");
735 // Test downcast for class inherited from a CustomView
736 MySpin mySpin = new MySpin();
737 mySpin.Name = "MySpinName";
738 mySpin.MyOwnName = "MyOwnSpinName";
739 mySpin.MaxValue = 8888;
740 mySpin._myCurrentValue = 5;
742 Console.WriteLine("mySpin.Name = " + mySpin.Name + ", MyOwnName = " + mySpin.MyOwnName + ", MaxValue = " + mySpin.MaxValue + ", currentValue = " + mySpin._myCurrentValue);
744 container.Add(mySpin);
746 Actor mySpinActor = container.FindChildByName("MySpinName");
749 MySpin newSpin = View.DownCast<MySpin>(mySpinActor);
752 Console.WriteLine("Downcast to MySpin successful: newSpin Name = " + newSpin.Name + ", MyOwnName = " + newSpin.MyOwnName + ", MaxValue = " + newSpin.MaxValue + ", currentValue = " + newSpin._myCurrentValue);
756 Console.WriteLine("Downcast to MySpin failed!");
760 Console.WriteLine("### [7] ViewDownCastTest END");
763 public void MainLoop()
765 _application.MainLoop();
769 /// The main entry point for the application.
772 static void Main(string[] args)
774 Console.WriteLine("Hello World");
776 Example example = new Example(Application.NewApplication());
780 private void LOG(string str, int result = -1)
782 if (result == 1) Console.WriteLine(str + " : test passed!");
783 else if (result == 0) Console.WriteLine(str + " : test failed! TEST FAILED! test failed! TEST FAILED!");
784 else Console.WriteLine(str);
787 private void CustomPropertyHighLevelClassTest()
789 LOG("=================================");
790 LOG(" high level class test");
791 LOG("=================================");
793 Handle handle = new Handle();
794 int myPropertyIndex1 = handle.RegisterProperty("myProperty1", new Property.Value(new Size(10, 20, 30)), Property.AccessMode.READ_WRITE);
795 Size myProperty1 = Dali.Size.Zero;
796 handle.GetProperty(myPropertyIndex1).Get(myProperty1);
797 if (myProperty1.EqualTo(new Size(10, 20, 30))) LOG( "myProperty1 must be Size(10, 20, 30) get=" + myProperty1, 1);
798 else LOG( "myProperty1 must be Size(10, 20, 30) get=" + myProperty1, 0);
800 int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Position(40, 50, 60)), Property.AccessMode.READ_WRITE);
801 Position myProperty2 = Dali.Position.Zero;
802 handle.GetProperty(myPropertyIndex2).Get(myProperty2);
803 if (myProperty2.EqualTo(new Position(40, 50, 60))) LOG( "myProperty2 must be Position(40, 50, 60) get=" + myProperty2, 1);
804 else LOG( "myProperty2 must be Position(40, 50, 60) get=" + myProperty2, 0);
806 int myPropertyIndex3 = handle.RegisterProperty("myProperty3", new Property.Value(Color.Cyan), Property.AccessMode.READ_WRITE);
807 Color myProperty3 = Color.Transparent;
808 handle.GetProperty(myPropertyIndex3).Get(myProperty3);
809 if (myProperty3.EqualTo(Color.Cyan)) LOG( "myProperty3 must be Color.Cyan get=" + myProperty3, 1);
810 else LOG( "myProperty3 must be Color.Cyan get=" + myProperty3, 0);
812 int myPropertyIndex4 = handle.RegisterProperty("myProperty4", new Property.Value(new Size2D(100, 200)), Property.AccessMode.READ_WRITE);
813 Size2D myProperty4 = new Size2D(0, 0);
814 handle.GetProperty(myPropertyIndex4).Get(myProperty4);
815 if (myProperty4.EqualTo(new Size2D(100, 200))) LOG( "myProperty4 must be new Size2D(100, 200) get=" + myProperty4, 1);
816 else LOG( "myProperty4 must be new Size2D(100, 200) get=" + myProperty4, 0);
818 int myPropertyIndex5 = handle.RegisterProperty("myProperty5", new Property.Value(new Position2D(200, 300)), Property.AccessMode.READ_WRITE);
819 Position2D myProperty5 = new Position2D(0, 0);
820 handle.GetProperty(myPropertyIndex5).Get(myProperty5);
821 if (myProperty5.EqualTo(new Position2D(200, 300))) LOG( "myProperty5 must be new Position2D(200, 300) get=" + myProperty5, 1);
822 else LOG( "myProperty5 must be new Position2D(200, 300) get=" + myProperty5, 0);
824 View view = new View();
825 view.Size2D = new Size2D(new Size(200.0f, 200.0f, 0.0f));
826 view.Name = "MyView1";
827 view.BackgroundColor = new Color(1.0f, 0.0f, 1.0f, 0.8f);
828 LOG("view id: " + view.GetId());
829 LOG("view size: " + view.Size.Width + ", " + view.Size.Height + "," + view.Size.Depth);
830 LOG("view size2d: " + view.Size2D.Width + ", " + view.Size2D.Height);
831 LOG("view name: " + view.Name);
833 Stage stage = Stage.GetCurrent();
834 Size2D stageSize = stage.Size;
835 LOG("Stage size2d: " + stageSize.Width + ", " + stageSize.Height);
838 Size Size = new Size(100, 50, 25);
839 LOG( Size + "Created. this should be (100, 50, 25)!");
840 LOG( "Size width= " + Size.Width + ", height=" + Size.Height + ",depth=" + Size.Depth );
841 Size += new Size(20, 20, 20);
842 if(Size.EqualTo(new Size(120, 70, 45))){ LOG( "plus Size(20,20,20) should be +20 for each! x = " + Size.Width + ", y = " + Size.Height + ", z = " + Size.Depth, 1);}
843 else { LOG( "plus Size(20,20,20) should be +20 for each! x = " + Size.Width + ", y = " + Size.Height + ", z = " + Size.Depth, 0);}
848 if(Size.EqualTo(new Size(130, 80, 55))){ LOG( "plus 10 for each! width = " + Size.Width + ", height = " + Size.Height + ", depth = " + Size.Depth, 1); }
849 else { LOG( "plus 10 for each! width = " + Size.Width + ", height = " + Size.Height + ", depth = " + Size.Depth, 0); }
851 Position Position = new Position(20, 100, 50);
852 LOG(Position + "Created ");
853 LOG( "Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z );
854 Position += new Position(20, 20, 20);
855 if(Position.EqualTo(new Position(40, 120, 70))) LOG( "plus Position(20, 20, 20)! Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z, 1);
856 else LOG( "plus Position(20, 20, 20)! Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z, 0);
861 if(Position.EqualTo(new Position(50, 130, 80))) LOG( "plus +10 for each! Position width = " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z, 1 );
862 else LOG( "plus +10 for each! Position width = " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z, 0 );
864 Position2D _position2d = new Position2D(new Position(600.0f, 700.0f, 800.0f));
865 LOG(_position2d + "Created ");
866 LOG( "_postion2d x = " + _position2d.X + ", y = " + _position2d.Y);
867 _position2d += new Position2D(20, 20);
868 if(_position2d.EqualTo(new Position2D(620, 720))) LOG( "plus Position2D(20, 20)! Position x = " + _position2d.X + ", y = " + _position2d.Y, 1);
869 else LOG( "plus Position2D(20, 20)! Position x = " + _position2d.X + ", y = " + _position2d.Y, 0);
871 Position parentOrigin = ParentOrigin.BottomRight;
872 LOG( "parentOrigin.BottomRight x=" + parentOrigin.X + ", y=" + parentOrigin.Y + ", z=" + parentOrigin.Z );
874 Color color = new Color(20, 100, 50, 200);
875 LOG( color + " Created ");
876 LOG( "Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A );
877 color += new Color(20, 20, 20, 20);
878 if(color.EqualTo(new Color(40, 120, 70, 220))) LOG( "plus Color(20, 20, 20, 20)! Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A, 1 );
879 else LOG( "plus Color(20, 20, 20, 20)! Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A, 0 );
884 if(color.EqualTo(new Color(50, 130, 80, 230))) LOG( "plus +10 for each! Color r = " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A, 1 );
885 else LOG( "plus +10 for each! Color r = " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A, 0 );
887 LOG("=================================");