Import 1.9b4 extra tag from cvs
[mozilla-extra.git] / extensions / mono / test / sample-app.cs
blobd95d0bbcb42eda7b66ed14736adcc32dbf34e5da
1 using System;
2 using Mozilla.XPCOM;
3 using Interfaces = Mozilla.XPCOM.Interfaces;
6 public class Test
8 class TestCallback : Mozilla.XPCOM.Interfaces.testCallback
10 public void Call() {
11 Console.WriteLine("Callback invoked!");
15 public static void Main()
17 Interfaces.test myTest = (Interfaces.test)
18 Components.CreateInstance("@off.net/test-component;1",
19 typeof(Interfaces.test));
20 Console.WriteLine("3 + 5 = {0}", myTest.Add(3, 5));
21 int before = myTest.IntProp;
22 myTest.IntProp = 99;
23 Console.WriteLine("intProp: {0}, (= 99), {1}", before, myTest.IntProp);
24 Console.WriteLine("roIntProp: {0}", myTest.RoIntProp);
25 Console.WriteLine("Invoking callback:");
26 TestCallback tcb = new TestCallback();
27 myTest.Callback(tcb);
28 Console.WriteLine("Done!");