private void btnPost_Click(object sender, EventArgs e) { if (false == CheckConfiguration()) { return; } //Save Configuration XDocument xdoc = new XDocument( new XElement("Setting", new XAttribute("X_ECG_UDID", X_ECG_UDID.Text), new XAttribute("Authorization", Authorization.Text), new XAttribute("AccountId", AccountId.Text), new XAttribute("Token", Token.Text), new XAttribute("MachineId", MachineId.Text), new XAttribute("Email", Email.Text), new XAttribute("SessionId", SessionId.Text) )); xdoc.Save("./config.xml"); Configuration configuration = new Configuration(); configuration.X_ECG_UDID = X_ECG_UDID.Text; configuration.Authorization = Authorization.Text; configuration.AccountId = AccountId.Text; configuration.Token = Token.Text; configuration.MachineId = MachineId.Text; configuration.Email = Email.Text; configuration.SessionId = SessionId.Text; PostAd.StartPosting(dataTable, configuration, csvLocation.Text, cts.Token, configuration.Delay); }
public static void StartBatch(DataTable dt, Configuration config, string csvLocation, CancellationToken token, int delay = 2) { PostAd.StartPosting(dt, config, csvLocation, token, delay); }