Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this is a class library in a DLL that does a fancy conversion process to a string
- namespace SecretStuff
- {
- public class Converter
- {
- public string Convert(string source)
- {
- return "Result of secret algorithm: " + SecretAlgotithm(source);
- }
- private string SecretAlgotithm(string input)
- {
- return input.ToUpper();
- }
- }
- }
- // this is a console program that refers to the DLL above
- using System;
- using SecretStuff;
- namespace Encapsulation
- {
- class Program
- {
- static void Main(string[] args)
- {
- var converter = new Converter();
- var message = "this is a secret message.";
- Console.WriteLine(converter.Convert(message));
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement