Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace We.Enterprise.Now
- {
- class HelloWorld
- {
- private string _helloString;
- public string HelloString
- {
- get
- {
- return _helloString;
- }
- set
- {
- _helloString = value;
- }
- }
- public HelloWorld(string helloString)
- {
- this.HelloString = helloString;
- }
- public void SayHello()
- {
- System.Console.WriteLine(_helloString);
- }
- }
- class HelloWorldFactory
- {
- private HelloWorld _helloWorld;
- public HelloWorld HelloWorldObject
- {
- get
- {
- return _helloWorld;
- }
- }
- public HelloWorldFactory(string factoryString)
- {
- _helloWorld = new HelloWorld(factoryString);
- }
- }
- class MainClass
- {
- static void Main(string[] args)
- {
- HelloWorldFactory helloWorldFactory;
- if (args.Length > 1)
- {
- helloWorldFactory = new HelloWorldFactory(args[1]);
- }
- else
- {
- helloWorldFactory = new HelloWorldFactory("Hello World, We Enterprise Now.");
- }
- helloWorldFactory.HelloWorldObject.SayHello();
- }
- }
- }
Add Comment
Please, Sign In to add comment