public Form1(ContosoConsultancyServiceProxy contosoConsultancyServiceProxy, IContractService contractService, IPdfService pdfService) { InitializeComponent(); this.contosoConsultancyServiceProxy = contosoConsultancyServiceProxy; this.contractService = contractService; this.pdfService = pdfService; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var uri = ConfigurationManager.AppSettings["ContosoConsultancy.RestAPI.Uri"]; var credentials = new BasicAuthenticationCredentials(); var client = new ContosoConsultancyRestClient(new Uri(uri), credentials); var serviceProxy = new ContosoConsultancyServiceProxy(client); var contractService = new ContractService(); var pdfService = new PdfService(); Application.Run(new Form1(serviceProxy, contractService, pdfService)); }