Ejemplo n.º 1
0
		public static int Main (string[] args)
		{
			GLib.GType.Init ();
			TestObject obj = new TestObject ();
			GLib.Value val = new GLib.Value (42);
			obj.SetProperty ("my_prop", val);
			val.Dispose ();
			if (obj.MyProp != 42) {
				Console.Error.WriteLine ("Property setter did not run.");
				return 1;
			}
			GLib.Value val2 = obj.GetProperty ("my_prop");
			if ((int)val2.Val != 42) {
				Console.Error.WriteLine ("Property set/get roundtrip failed.");
				return 1;
			}
			Console.WriteLine ("Round trip succeeded.");
			return 0;
		}
Ejemplo n.º 2
0
        public static int Main(string[] args)
        {
            GLib.GType.Init();
            TestObject obj = new TestObject();

            GLib.Value val = new GLib.Value(42);
            obj.SetProperty("my_prop", val);
            val.Dispose();
            if (obj.MyProp != 42)
            {
                Console.Error.WriteLine("Property setter did not run.");
                return(1);
            }
            GLib.Value val2 = obj.GetProperty("my_prop");
            if ((int)val2.Val != 42)
            {
                Console.Error.WriteLine("Property set/get roundtrip failed.");
                return(1);
            }
            Console.WriteLine("Round trip succeeded.");
            return(0);
        }