/*
Copyright (C) 2011-2012 de4dot@gmail.com
This file is part of de4dot.
de4dot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
de4dot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with de4dot. If not, see .
*/
using System;
using System.Collections;
using System.Collections.Generic;
namespace Test.Rename.Dll {
static class g {
static public T m(T t) {
return t;
}
public delegate void Func1();
}
namespace test.fields.instance {
class Class1 {
public int var1 = g.m(1);
public int var2 = g.m(2);
protected int var3 = g.m(3);
protected int var4 = g.m(4);
private int var5 = g.m(5);
private int var6 = g.m(6);
}
class Class2 : Class1 {
public new int var1 = g.m(10);
public new int var2 = g.m(20);
protected new int var3 = g.m(30);
protected new int var4 = g.m(40);
private int var5 = g.m(50);
private int var6 = g.m(60);
}
class Class3 : Class1 {
public new int var1 = g.m(100);
public new int var2 = g.m(200);
protected new int var3 = g.m(300);
protected new int var4 = g.m(400);
private int var5 = g.m(500);
private int var6 = g.m(600);
}
}
namespace test.fields.Static {
class Class1 {
public static int var1 = g.m(1);
public static int var2 = g.m(2);
protected static int var3 = g.m(3);
protected static int var4 = g.m(4);
private static int var5 = g.m(5);
private static int var6 = g.m(6);
}
class Class2 : Class1 {
public new static int var1 = g.m(10);
public new static int var2 = g.m(20);
protected new static int var3 = g.m(30);
protected new static int var4 = g.m(40);
private static int var5 = g.m(50);
private static int var6 = g.m(60);
}
class Class3 : Class1 {
public new static int var1 = g.m(100);
public new static int var2 = g.m(200);
protected new static int var3 = g.m(300);
protected new static int var4 = g.m(400);
private static int var5 = g.m(500);
private static int var6 = g.m(600);
}
}
namespace test.props.instance {
class Class1 {
public int prop1 { get; set; }
public int prop2 { get; set; }
protected int prop3 { get; set; }
protected int prop4 { get; set; }
private int prop5 { get; set; }
private int prop6 { get; set; }
}
class Class2 : Class1 {
public new int prop1 { get; set; }
public new int prop2 { get; set; }
protected new int prop3 { get; set; }
protected new int prop4 { get; set; }
private int prop5 { get; set; }
private int prop6 { get; set; }
}
class Class3 : Class1 {
public new int prop1 { get; set; }
public new int prop2 { get; set; }
protected new int prop3 { get; set; }
protected new int prop4 { get; set; }
private int prop5 { get; set; }
private int prop6 { get; set; }
}
}
namespace test.props.Virtual {
class Class1 {
public virtual int prop1 { get; set; }
public virtual int prop2 { get; set; }
protected virtual int prop3 { get; set; }
protected virtual int prop4 { get; set; }
}
class Class2 : Class1 {
public override int prop1 { get; set; }
public override int prop2 { get; set; }
protected override int prop3 { get; set; }
protected override int prop4 { get; set; }
}
class Class3 : Class1 {
public override int prop1 { get; set; }
public override int prop2 { get; set; }
protected override int prop3 { get; set; }
protected override int prop4 { get; set; }
}
}
namespace test.props.Virtual.newslot {
class Class1 {
public virtual int prop1 { get; set; }
public virtual int prop2 { get; set; }
protected virtual int prop3 { get; set; }
protected virtual int prop4 { get; set; }
}
class Class2 : Class1 {
public new virtual int prop1 { get; set; }
public new virtual int prop2 { get; set; }
protected new virtual int prop3 { get; set; }
protected new virtual int prop4 { get; set; }
}
class Class3 : Class1 {
public new virtual int prop1 { get; set; }
public new virtual int prop2 { get; set; }
protected new virtual int prop3 { get; set; }
protected new virtual int prop4 { get; set; }
}
}
namespace test.props.Abstract {
abstract class Class1 {
public abstract int prop1 { get; set; }
public abstract int prop2 { get; set; }
protected abstract int prop3 { get; set; }
protected abstract int prop4 { get; set; }
}
class Class2 : Class1 {
public override int prop1 { get; set; }
public override int prop2 { get; set; }
protected override int prop3 { get; set; }
protected override int prop4 { get; set; }
}
class Class3 : Class1 {
public override int prop1 { get; set; }
public override int prop2 { get; set; }
protected override int prop3 { get; set; }
protected override int prop4 { get; set; }
}
}
namespace test.props.Interface1 {
interface IFace1 {
int prop1 { get; set; }
int prop2 { get; set; }
}
class Class1 : IFace1 {
public int prop1 { get; set; }
public int prop2 { get; set; }
}
}
namespace test.props.Interface2 {
interface IFace1 {
int prop1 { get; set; }
int prop2 { get; set; }
}
interface IFace2 {
int prop1 { get; set; }
int prop2 { get; set; }
}
class Class1 : IFace1, IFace2 {
public int prop1 { get; set; }
public int prop2 { get; set; }
}
}
namespace test.props.Interface3 {
interface IFace1 {
int prop1 { get; set; }
int prop2 { get; set; }
}
interface IFace2 {
int prop1 { get; set; }
int prop2 { get; set; }
}
class Class1 : IFace1, IFace2 {
public int prop1 { get; set; }
public int prop2 { get; set; }
int IFace1.prop1 { get; set; }
int IFace1.prop2 { get; set; }
int IFace2.prop1 { get; set; }
int IFace2.prop2 { get; set; }
}
}
namespace test.props.Interface4 {
interface IFace1 {
int prop1 { get; set; }
int prop2 { get; set; }
}
interface IFace2 : IFace1 {
new int prop1 { get; set; }
new int prop2 { get; set; }
}
class Class1 : IFace2 {
public int prop1 { get; set; }
public int prop2 { get; set; }
}
}
namespace test.props.Interface5 {
interface IFace1 {
int prop1 { get; set; }
int prop2 { get; set; }
int prop3 { get; set; }
int prop4 { get; set; }
}
interface IFace2 {
int prop5 { get; set; }
int prop6 { get; set; }
}
class Class1 : IFace1, IFace2 {
public int prop1 { get; set; }
public int prop2 { get; set; }
public int prop3 { get; set; }
public int prop4 { get; set; }
public int prop5 { get; set; }
public int prop6 { get; set; }
}
}
namespace test.props.Interface6 {
interface IFace1 {
int prop1 { get; set; }
}
interface IFace2 {
int prop2 { get; set; }
}
interface IFace3 {
int prop3 { get; set; }
}
interface IFace4 {
int prop4 { get; set; }
}
interface IFace5 {
int prop5 { get; set; }
}
class Class4 : IFace1, IFace2, IFace3 {
public int prop1 { get; set; }
public int prop2 { get; set; }
public int prop3 { get; set; }
}
class Class5 : IFace1 {
public int prop1 { get; set; }
}
class Class6 : IFace3, IFace4, IFace5 {
public int prop3 { get; set; }
public int prop4 { get; set; }
public int prop5 { get; set; }
}
}
namespace test.props.Interface7 {
interface IFace1 {
int prop1 { get; set; }
}
interface IFace2 {
int prop2 { get; set; }
}
interface IFace3 {
int prop3 { get; set; }
}
class Class1 {
}
class Class2 : Class1, IFace1 {
public int prop1 { get; set; }
}
class Class3 : Class1, IFace2 {
public int prop2 { get; set; }
}
class Class4 : Class3 {
}
class Class5 : Class3, IFace3 {
public int prop3 { get; set; }
}
}
namespace test.props.valuearg {
class Class1 {
int i;
int Prop1 {
get { return 1; }
set { i = value; }
}
}
}
namespace test.events.instance {
class Class1 {
public event g.Func1 event1;
public event g.Func1 event2;
protected event g.Func1 event3;
protected event g.Func1 event4;
private event g.Func1 event5;
private event g.Func1 event6;
}
class Class2 : Class1 {
public new event g.Func1 event1;
public new event g.Func1 event2;
protected new event g.Func1 event3;
protected new event g.Func1 event4;
private event g.Func1 event5;
private event g.Func1 event6;
}
class Class3 : Class1 {
public new event g.Func1 event1;
public new event g.Func1 event2;
protected new event g.Func1 event3;
protected new event g.Func1 event4;
private event g.Func1 event5;
private event g.Func1 event6;
}
}
namespace test.events.Virtual {
class Class1 {
public virtual event g.Func1 event1;
public virtual event g.Func1 event2;
protected virtual event g.Func1 event3;
protected virtual event g.Func1 event4;
}
class Class2 : Class1 {
public override event g.Func1 event1;
public override event g.Func1 event2;
protected override event g.Func1 event3;
protected override event g.Func1 event4;
}
class Class3 : Class1 {
public override event g.Func1 event1;
public override event g.Func1 event2;
protected override event g.Func1 event3;
protected override event g.Func1 event4;
}
}
namespace test.events.Virtual.newslot {
class Class1 {
public virtual event g.Func1 event1;
public virtual event g.Func1 event2;
protected virtual event g.Func1 event3;
protected virtual event g.Func1 event4;
}
class Class2 : Class1 {
public new virtual event g.Func1 event1;
public new virtual event g.Func1 event2;
protected new virtual event g.Func1 event3;
protected new virtual event g.Func1 event4;
}
class Class3 : Class1 {
public new virtual event g.Func1 event1;
public new virtual event g.Func1 event2;
protected new virtual event g.Func1 event3;
protected new virtual event g.Func1 event4;
}
}
namespace test.events.Abstract {
abstract class Class1 {
public abstract event g.Func1 event1;
public abstract event g.Func1 event2;
protected abstract event g.Func1 event3;
protected abstract event g.Func1 event4;
}
class Class2 : Class1 {
public override event g.Func1 event1;
public override event g.Func1 event2;
protected override event g.Func1 event3;
protected override event g.Func1 event4;
}
class Class3 : Class1 {
public override event g.Func1 event1;
public override event g.Func1 event2;
protected override event g.Func1 event3;
protected override event g.Func1 event4;
}
}
namespace test.events.Interface1 {
interface IFace1 {
event g.Func1 event1;
event g.Func1 event2;
}
class Class1 : IFace1 {
public event g.Func1 event1;
public event g.Func1 event2;
}
}
namespace test.events.Interface2 {
interface IFace1 {
event g.Func1 event1;
event g.Func1 event2;
}
interface IFace2 {
event g.Func1 event1;
event g.Func1 event2;
}
class Class1 : IFace1, IFace2 {
public event g.Func1 event1;
public event g.Func1 event2;
}
}
namespace test.events.Interface3 {
interface IFace1 {
event g.Func1 event1;
event g.Func1 event2;
}
interface IFace2 {
event g.Func1 event1;
event g.Func1 event2;
}
class Class1 : IFace1, IFace2 {
public event g.Func1 event1;
public event g.Func1 event2;
event g.Func1 IFace1.event1 {
add { }
remove { }
}
event g.Func1 IFace1.event2 {
add { }
remove { }
}
event g.Func1 IFace2.event1 {
add { }
remove { }
}
event g.Func1 IFace2.event2 {
add { }
remove { }
}
}
}
namespace test.events.Interface4 {
interface IFace1 {
event g.Func1 event1;
event g.Func1 event2;
}
interface IFace2 : IFace1 {
new event g.Func1 event1;
new event g.Func1 event2;
}
class Class1 : IFace2 {
public event g.Func1 event1;
public event g.Func1 event2;
}
}
namespace test.events.Interface5 {
interface IFace1 {
event g.Func1 event1;
event g.Func1 event2;
event g.Func1 event3;
event g.Func1 event4;
}
interface IFace2 {
event g.Func1 event5;
event g.Func1 event6;
}
class Class1 : IFace1, IFace2 {
public event g.Func1 event1;
public event g.Func1 event2;
public event g.Func1 event3;
public event g.Func1 event4;
public event g.Func1 event5;
public event g.Func1 event6;
}
}
namespace test.events.Interface6 {
interface IFace1 {
event g.Func1 event1;
}
interface IFace2 {
event g.Func1 event2;
}
interface IFace3 {
event g.Func1 event3;
}
interface IFace4 {
event g.Func1 event4;
}
interface IFace5 {
event g.Func1 event5;
}
class Class4 : IFace1, IFace2, IFace3 {
public event g.Func1 event1;
public event g.Func1 event2;
public event g.Func1 event3;
}
class Class5 : IFace1 {
public event g.Func1 event1;
}
class Class6 : IFace3, IFace4, IFace5 {
public event g.Func1 event3;
public event g.Func1 event4;
public event g.Func1 event5;
}
}
namespace test.events.Interface7 {
interface IFace1 {
event g.Func1 event1;
}
interface IFace2 {
event g.Func1 event2;
}
interface IFace3 {
event g.Func1 event3;
}
class Class1 {
}
class Class2 : Class1, IFace1 {
public event g.Func1 event1;
}
class Class3 : Class1, IFace2 {
public event g.Func1 event2;
}
class Class4 : Class3 {
}
class Class5 : Class3, IFace3 {
public event g.Func1 event3;
}
}
namespace test.events.valuearg {
class Class1 {
g.Func1 f;
event g.Func1 Event {
add { f += value; }
remove { f -= value; }
}
}
}
namespace test.methods.instance {
class Class1 {
public void meth1() { }
public void meth2() { }
protected void meth3() { }
protected void meth4() { }
private void meth5() { }
private void meth6() { }
}
class Class2 : Class1 {
public new void meth1() { }
public new void meth2() { }
protected new void meth3() { }
protected new void meth4() { }
private void meth5() { }
private void meth6() { }
}
class Class3 : Class1 {
public new void meth1() { }
public new void meth2() { }
protected new void meth3() { }
protected new void meth4() { }
private void meth5() { }
private void meth6() { }
}
}
namespace test.methods.Static {
class Class1 {
public static void meth1() { }
public static void meth2() { }
protected static void meth3() { }
protected static void meth4() { }
private static void meth5() { }
private static void meth6() { }
}
class Class2 : Class1 {
public new static void meth1() { }
public new static void meth2() { }
protected new static void meth3() { }
protected new static void meth4() { }
private static void meth5() { }
private static void meth6() { }
}
class Class3 : Class1 {
public new static void meth1() { }
public new static void meth2() { }
protected new static void meth3() { }
protected new static void meth4() { }
private static void meth5() { }
private static void meth6() { }
}
}
namespace test.methods.Virtual {
class Class1 {
public virtual void meth1() { }
public virtual void meth2() { }
protected virtual void meth3() { }
protected virtual void meth4() { }
}
class Class2 : Class1 {
public override void meth1() { }
public override void meth2() { }
protected override void meth3() { }
protected override void meth4() { }
}
class Class3 : Class1 {
public override void meth1() { }
public override void meth2() { }
protected override void meth3() { }
protected override void meth4() { }
}
}
namespace test.methods.Virtual.newslot {
class Class1 {
public virtual void meth1() { }
public virtual void meth2() { }
protected virtual void meth3() { }
protected virtual void meth4() { }
}
class Class2 : Class1 {
public new virtual void meth1() { }
public new virtual void meth2() { }
protected new virtual void meth3() { }
protected new virtual void meth4() { }
}
class Class3 : Class1 {
public new virtual void meth1() { }
public new virtual void meth2() { }
protected new virtual void meth3() { }
protected new virtual void meth4() { }
}
}
namespace test.methods.Abstract {
abstract class Class1 {
public abstract void meth1();
public abstract void meth2();
protected abstract void meth3();
protected abstract void meth4();
}
class Class2 : Class1 {
public override void meth1() { }
public override void meth2() { }
protected override void meth3() { }
protected override void meth4() { }
}
class Class3 : Class1 {
public override void meth1() { }
public override void meth2() { }
protected override void meth3() { }
protected override void meth4() { }
}
}
namespace test.methods.Interface1 {
interface IFace1 {
void meth1();
void meth2();
}
class Class1 : IFace1 {
public void meth1() { }
public void meth2() { }
}
}
namespace test.methods.Interface2 {
interface IFace1 {
void meth1();
void meth2();
}
interface IFace2 {
void meth1();
void meth2();
}
class Class1 : IFace1, IFace2 {
public void meth1() { }
public void meth2() { }
}
}
namespace test.methods.Interface3 {
interface IFace1 {
void meth1();
void meth2();
}
interface IFace2 {
void meth1();
void meth2();
}
class Class1 : IFace1, IFace2 {
public void meth1() { }
public void meth2() { }
void IFace1.meth1() { }
void IFace1.meth2() { }
void IFace2.meth1() { }
void IFace2.meth2() { }
}
}
namespace test.methods.Interface4 {
interface IFace1 {
void meth1();
void meth2();
}
interface IFace2 : IFace1 {
new void meth1();
new void meth2();
}
class Class1 : IFace2 {
public void meth1() { }
public void meth2() { }
}
}
namespace test.methods.Interface5 {
interface IFace1 {
void meth1();
void meth2();
void meth3();
void meth4();
}
interface IFace2 {
void meth5();
void meth6();
}
class Class1 : IFace1, IFace2 {
public void meth1() { }
public void meth2() { }
public void meth3() { }
public void meth4() { }
public void meth5() { }
public void meth6() { }
}
}
namespace test.methods.Interface6 {
interface IFace1 {
void meth1();
}
interface IFace2 {
void meth2();
}
interface IFace3 {
void meth3();
}
interface IFace4 {
void meth4();
}
interface IFace5 {
void meth5();
}
class Class4 : IFace1, IFace2, IFace3 {
public void meth1() { }
public void meth2() { }
public void meth3() { }
}
class Class5 : IFace1 {
public void meth1() { }
}
class Class6 : IFace3, IFace4, IFace5 {
public void meth3() { }
public void meth4() { }
public void meth5() { }
}
}
namespace test.methods.Interface7 {
interface IFace1 {
void meth1();
}
interface IFace2 {
void meth2();
}
interface IFace3 {
void meth3();
}
class Class1 {
}
class Class2 : Class1, IFace1 {
public void meth1() { }
}
class Class3 : Class1, IFace2 {
public void meth2() { }
}
class Class4 : Class3 {
}
class Class5 : Class3, IFace3 {
public void meth3() { }
}
}
namespace test.methods.signatures {
enum consts {
val1, val2, val3,
}
struct data1 {
int i;
}
struct data2 {
int i;
}
class Class1 {
void meth1() { }
void meth1(int i) { }
unsafe void meth1(int* i) { }
void meth1(int i, int j) { }
void meth1(short i) { }
void meth1(string s) { }
void meth1(consts c) { }
void meth1(data1 d) { }
void meth1(data2 d) { }
void meth1(List l1, List l2) { }
void meth1(List l1, List l2) { }
void meth1(List l1, List l2) { }
void meth1(List l1, List l2) { }
void meth1(List>>> l1, List l2) { }
void meth1(List>>> l1, List> l2) { }
void meth1(List>>> l1, List>> l2) { }
void meth1(List>>> l1, List>>> l2) { }
void meth1(List>>> l1, List>>> l2) { }
void meth1(List>>> l1, List>>> l2) { }
void meth1(List>>> l1, List>>> l2) { }
void meth2() { }
void meth2(int i) { }
void meth2(int i, int j) { }
}
}
namespace test.interfaces.test1 {
interface IFace1 {
void meth1();
void meth1(int i);
void meth1(string s);
event g.Func1 Event1;
int Prop1 { get; set; }
int Prop2 { get; set; }
string Prop3 { get; set; }
}
interface IFace2 : IFace1 {
void meth1();
void meth1(int i);
void meth1(string s);
event g.Func1 Event1;
int Prop1 { get; set; }
int Prop2 { get; set; }
string Prop3 { get; set; }
}
class Class1 : IFace2 {
public void meth1() { }
public void meth1(int i) { }
public void meth1(string s) { }
public event g.Func1 Event1;
public int Prop1 { get; set; }
public int Prop2 { get; set; }
public string Prop3 { get; set; }
}
}
namespace test.enums.test1 {
enum consts1 { }
enum consts2 { a, b, c, d, e }
}
namespace test.structs.test1 {
struct d1 { }
struct d2 {
int i;
int j;
string s;
d1 d1;
}
}
namespace test.structs.test2 {
interface IFace1 {
int prop1 { get; set; }
string prop2 { get; set; }
object meth1(int i);
}
interface IFace2 {
int prop3 { get; set; }
void meth1(int i); // different return type
}
struct d1 : IFace1, IFace2 {
public int prop1 { get; set; }
public string prop2 { get; set; }
public object meth1(int i) { return null; }
public int prop3 { get; set; }
void IFace2.meth1(int i) { }
}
}
namespace test.variables.test1 {
class Class1 {
byte aByte = 123;
byte[] anArray = new byte[11];
byte[][] anArray2 = new byte[11][];
List aList = new List();
short aShort;
int anInt;
string aString;
Class1 aClass;
}
}
namespace test.generic.types.methods1 {
class Class1 {
T a;
U b;
V c;
void meth1(T a) { }
void meth1(U a) { }
void meth1(V a) { }
void meth1(List a) { }
void meth1(List a) { }
void meth1(List a) { }
}
}
namespace test.generic.types.methods2 {
class Class1 {
void meth1(int i) { }
void meth1(int i) { }
void meth1(int i) { }
void meth1(W w) { }
void meth1(T t) { }
void meth1(U u) { }
void meth1(V v) { }
void meth1(T t, T t2) { }
void meth1(U u, U u2) { }
void meth1(V v, V v2) { }
void meth1(T t, U u) { }
void meth1(T t, V V) { }
void meth1(U u, T t) { }
void meth1(U u, V v) { }
void meth1(V v, T t) { }
void meth1(V v, U u) { }
void meth1(W w, W w2) { }
void meth1(T t, T t2) { }
void meth1(U u, U u2) { }
void meth1(V v, V v2) { }
void meth1(W w, T t) { }
void meth1(W w, U u) { }
void meth1(W w, V v) { }
void meth1(T t, W w) { }
void meth1(U u, W w) { }
void meth1(V v, W w) { }
}
}
namespace test.generic.types.instance {
class Class1 {
public T meth1(T t) { return t; }
public U meth1(U u) { return u; }
public V meth1(T t) { return default(V); }
public V meth2(V v) { return v; }
}
static class Class2 {
static void meth1() {
var t = new Class1();
t.meth1(123);
t.meth1("hello");
t.meth1(45);
t.meth1