private void BtnDuplicate_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TriggerName)) { MailTrigger trigger = CDO.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault(); MailTrigger newTrigger = trigger.Clone(trigger); CDO.Triggers.Add(newTrigger); CustomDataObject.Save <AutoMailerCDO>(AutoMailerCDO.Key, CDO); SetupControls(); } }
private void BtnDuplicate_Click(object sender, EventArgs e) { AutoMailerCDORoot cdo = AutoMailerCDO.CDO; if (!string.IsNullOrEmpty(TriggerName)) { MailTrigger trigger = cdo.Triggers.Where(x => x.Name.Equals(TriggerName)).FirstOrDefault(); MailTrigger newTrigger = trigger.Clone(trigger); cdo.Triggers.Add(newTrigger); AutoMailerCDO.UpdateCDO(cdo); AutoMailerCDO.UploadCDO(); SetupControls(); } }