Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 20th, 2011  |  syntax: C#  |  size: 0.77 KB  |  views: 56  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2.  
  3.  
  4. namespace SomeSuspeciousAssembly
  5. {
  6.     class SomeSuspeciousClass
  7.     {
  8.         //Some junk malicious code
  9.     }
  10.  
  11. }
  12.  
  13. namespace ConsoleApplication1
  14. {
  15.     abstract class MyBase<T> where T : MyBase<T>
  16.     {
  17.         public void MyMethod()
  18.         {
  19.             Console.WriteLine("MyMethod");
  20.         }
  21.     }
  22.  
  23.     class MyDerived : MyBase<MyDerived>
  24.     {
  25.  
  26.     }
  27.  
  28.     class MyOtherDerived :
  29.         MyBase<SomeSuspeciousAssembly.SomeSuspeciousClass>//Gives error. Should not be done.
  30.     {
  31.  
  32.     }
  33.  
  34.    
  35.     class Program
  36.     {        
  37.         static void Main(string[] args)
  38.         {
  39.             MyBase<MyDerived> obj = new MyDerived();
  40.             obj.MyMethod();
  41.             Console.ReadLine();
  42.         }        
  43.     }
  44.      
  45. }