1 // Ported from Python li_attribute_runme.py
4 using li_attributeNamespace;
6 public class li_attribute_runme {
8 public static void Main() {
12 throw new ApplicationException("error");
15 throw new ApplicationException("error");
18 throw new ApplicationException("error");
21 throw new ApplicationException("error");
24 throw new ApplicationException("error");
27 throw new ApplicationException("error");
30 // throw new ApplicationException("error");
32 Param_i pi = new Param_i(7);
34 throw new ApplicationException("error");
38 throw new ApplicationException("error");
43 throw new ApplicationException("error");
45 // class/struct attribute with get/set methods using return/pass by reference
46 MyFoo myFoo = new MyFoo();
48 MyClass myClass = new MyClass();
50 if (myClass.Foo.x != 8)
51 throw new ApplicationException("error");
53 // class/struct attribute with get/set methods using return/pass by value
54 MyClassVal myClassVal = new MyClassVal();
55 if (myClassVal.ReadWriteFoo.x != -1)
56 throw new ApplicationException("error");
57 if (myClassVal.ReadOnlyFoo.x != -1)
58 throw new ApplicationException("error");
59 myClassVal.ReadWriteFoo = myFoo;
60 if (myClassVal.ReadWriteFoo.x != 8)
61 throw new ApplicationException("error");
62 if (myClassVal.ReadOnlyFoo.x != 8)
63 throw new ApplicationException("error");
65 // string attribute with get/set methods using return/pass by value
66 MyStringyClass myStringClass = new MyStringyClass("initial string");
67 if (myStringClass.ReadWriteString != "initial string")
68 throw new ApplicationException("error");
69 if (myStringClass.ReadOnlyString != "initial string")
70 throw new ApplicationException("error");
71 myStringClass.ReadWriteString = "changed string";
72 if (myStringClass.ReadWriteString != "changed string")
73 throw new ApplicationException("error");
74 if (myStringClass.ReadOnlyString != "changed string")
75 throw new ApplicationException("error");