Exemplo n.º 1
0
        public override IHelloWorld CreateInstance(HelloWorldTypes clientType, string logTo)
        {
            switch (clientType)
            {
            case HelloWorldTypes.Console:
                return(new HelloWorldConsole()
                {
                    logTo = logTo
                });

            case HelloWorldTypes.Mobile:
                throw new ApplicationException(string.Format("Client '{0}' cannot be created", clientType.ToString()));

            case HelloWorldTypes.Web:
                throw new ApplicationException(string.Format("Client '{0}' cannot be created", clientType.ToString()));

            case HelloWorldTypes.WebService:
                throw new ApplicationException(string.Format("Client '{0}' cannot be created", clientType.ToString()));

            default:
                throw new ApplicationException(string.Format("Client type is unknown"));
            }
        }
 public abstract IHelloWorld CreateInstance(HelloWorldTypes clientType, string writeToLocation);
Exemplo n.º 3
0
 public abstract IHelloWorld CreateInstance(HelloWorldTypes clientType, string logTo);