public MainApplication() { InitializeComponent(); this.ResultPath = @"D:\Sentresult.txt"; var container = new WindsorContainer(); container.Register( Component.For <ISMSProvider>().ImplementedBy <AtiehSMSProvider>()); container.Register( Component.For <ISMSConfiguration>().ImplementedBy <AtiehSMSConfiguration>()); container.Register( Component.For <IResultRegistrar>().ImplementedBy <FileResultRegistrar>()); container.Register( Component.For <BulkMessageSender>().ImplementedBy <BulkMessageSender>()); container.Register( Component.For <IFileReader>().ImplementedBy <CSVReader>()); bulkMessageSender = container.Resolve <BulkMessageSender>(); reader = container.Resolve <IFileReader>(); config = container.Resolve <ISMSConfiguration>(); config.ChangeConfig(Properties.Settings.Default.Username, Properties.Settings.Default.Password, Properties.Settings.Default.SourceNumber, Properties.Settings.Default.UrlAddress ); bulkMessageSender.OneSendHandled += BulkMessageSender_OneSMSSent; }
private void ConfigBtn_Click(object sender, EventArgs e) { var frm = new Configuration(); var result = frm.ShowDialog(this); if (result == DialogResult.OK) { config.ChangeConfig(Properties.Settings.Default.Username, Properties.Settings.Default.Password, Properties.Settings.Default.SourceNumber, Properties.Settings.Default.UrlAddress ); } }