code_junkie

How can a class have no constructor?

Nov 11th, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. //Initialize this stuff with some crap
  2. string appVirtualDir = "/";
  3. string appPhysicalDir = @"C:Documents and Settings";
  4. string page = @"localhost";
  5. string query = string.Empty;
  6. TextWriter output = null;
  7. //Create a SimpleWorkerRequest object passing down the crap
  8. SimpleWorkerRequest workerRequest = new SimpleWorkerRequest(appVirtualDir, appPhysicalDir, page, query, output);
  9. //Create your fake HttpContext instance
  10. HttpContext.Current = new HttpContext(workerRequest);
  11.  
  12. MyClass c = new MyClass();
  13.  
  14. MyClass c = MyClass.getInstance();
  15.  
  16. Class A{
  17. public static readonly A Instance = new A();
  18.  
  19. private A()
  20. {
  21. }
  22.  
  23. }
Add Comment
Please, Sign In to add comment