0510252385
Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
44 lines
596 B
C#
44 lines
596 B
C#
// Compiler options: -r:$REF_DIR/Mono.Cecil.dll
|
|
|
|
using System;
|
|
using Mono.Cecil;
|
|
|
|
class Test
|
|
{
|
|
public static string A
|
|
{
|
|
get { return ""; }
|
|
}
|
|
|
|
public string B
|
|
{
|
|
get { return ""; }
|
|
}
|
|
|
|
public static int Main ()
|
|
{
|
|
var assembly = AssemblyDefinition.ReadAssembly (typeof (Test).Assembly.Location);
|
|
var t = assembly.MainModule.GetType ("Test");
|
|
foreach (var p in t.Properties)
|
|
{
|
|
switch (p.Name) {
|
|
case "A":
|
|
if (!p.HasThis)
|
|
break;
|
|
|
|
return 1;
|
|
case "B":
|
|
if (p.HasThis)
|
|
break;
|
|
|
|
return 2;
|
|
default:
|
|
return 3;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
|