Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2782 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
5 changed files with 1220 additions and 0 deletions
@ -0,0 +1,85 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||||
|
// <version>$Revision: 1634 $</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Debugger.Tests.TestPrograms |
||||||
|
{ |
||||||
|
public class MainClass |
||||||
|
{ |
||||||
|
public static void Main() |
||||||
|
{ |
||||||
|
GenericClass<int, string> gClass = new GenericClass<int, string>(); |
||||||
|
gClass.Metod(1, "1!"); |
||||||
|
gClass.GenericMethod<bool>(1, "1!"); |
||||||
|
GenericClass<int, string>.StaticMetod(1, "1!"); |
||||||
|
GenericClass<int, string>.StaticGenericMethod<bool>(1, "1!"); |
||||||
|
|
||||||
|
GenericStruct<int, string> gStruct = new GenericStruct<int, string>(); |
||||||
|
gStruct.Metod(1, "1!"); |
||||||
|
gStruct.GenericMethod<bool>(1, "1!"); |
||||||
|
GenericStruct<int, string>.StaticMetod(1, "1!"); |
||||||
|
GenericStruct<int, string>.StaticGenericMethod<bool>(1, "1!"); |
||||||
|
|
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public class GenericClass<V, K> |
||||||
|
{ |
||||||
|
public K Metod(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return k; |
||||||
|
} |
||||||
|
|
||||||
|
public T GenericMethod<T>(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return default(T); |
||||||
|
} |
||||||
|
|
||||||
|
public static K StaticMetod(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return k; |
||||||
|
} |
||||||
|
|
||||||
|
public static T StaticGenericMethod<T>(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return default(T); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public struct GenericStruct<V, K> |
||||||
|
{ |
||||||
|
public K Metod(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return k; |
||||||
|
} |
||||||
|
|
||||||
|
public T GenericMethod<T>(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return default(T); |
||||||
|
} |
||||||
|
|
||||||
|
public static K StaticMetod(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return k; |
||||||
|
} |
||||||
|
|
||||||
|
public static T StaticGenericMethod<T>(V v, K k) |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
return default(T); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue