Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

44 lines
608 B
C#

// Compiler options: -r:../class/lib/net_4_5/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;
}
}