daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. XmlAttribute id = doc.CreateAttribute("id");
  2.                 id.Value = (i + 1).ToString();
  3.  
  4.                 XmlAttribute type = doc.CreateAttribute("type");
  5.                 type.Value = comboBoxNO2.SelectedItem.ToString();
  6.  
  7.                 XmlAttribute active = doc.CreateAttribute("active");
  8.                 active.Value = checkBoxNO2.Checked ? "true" : "false";
  9.  
  10.                 newCondition.Attributes.Append(id);
  11.                 newCondition.Attributes.Append(type);
  12.                 newCondition.Attributes.Append(active);
  13.  
  14.                 newCondition.InnerText = comboBoxNO2.SelectedItem.ToString() == "between" ? textBoxNO2.Text + "-" + textBoxNO2Max.Text : textBoxNO2.Text;
  15.  
  16.                 parameter.AppendChild(newCondition);
  17.                 doc.Save("trigger-rules.xml");
RAW Paste Data
Top