/usr/share/gtk-sharp2-examples/PropertyRegistration.cs is in gtk-sharp2-examples 2.12.40-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | // PropertyRegistration.cs - GObject property registration sample
//
// Author: Mike Kestner <mkestner@novell.com>
//
// Copyright (c) 2008 Novell, Inc.
namespace GtkSamples {
using System;
public class TestObject : GLib.Object {
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;
}
int my_prop;
[GLib.Property ("my_prop")]
public int MyProp {
get { return my_prop; }
set {
my_prop = value;
Console.WriteLine ("Property setter invoked.");
}
}
}
}
|