Advertisement
Guest User

Untitled

a guest
May 27th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // this is a class library in a DLL that does a fancy conversion process to a string
  2.  
  3. namespace SecretStuff
  4. {
  5. public class Converter
  6. {
  7. public string Convert(string source)
  8. {
  9. return "Result of secret algorithm: " + SecretAlgotithm(source);
  10. }
  11.  
  12. private string SecretAlgotithm(string input)
  13. {
  14. return input.ToUpper();
  15. }
  16. }
  17. }
  18.  
  19. // this is a console program that refers to the DLL above
  20. using System;
  21. using SecretStuff;
  22.  
  23. namespace Encapsulation
  24. {
  25. class Program
  26. {
  27. static void Main(string[] args)
  28. {
  29. var converter = new Converter();
  30. var message = "this is a secret message.";
  31.  
  32. Console.WriteLine(converter.Convert(message));
  33. Console.ReadKey();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement