private void AddAttribute()
 {
     AttributeEditor ed = new AttributeEditor(true);
     ed.Key = "key";
     ed.Value = "value";
     if (ed.ShowDialog() == DialogResult.OK)
     {
         attrList.Items.Add(CreateAttributeItem(new StringAttribute(Node, ed.Key, ed.Value)));
         attrList.Refresh();
     }
 }
 private void EditSelectedAttribute()
 {
     if (attrList.SelectedItems != null && attrList.SelectedItems.Count > 0)
     {
         AttributeEditor ed = new AttributeEditor(false);
         ed.Key = attrList.SelectedItems[0].SubItems[0].Text;
         ed.Value = attrList.SelectedItems[0].SubItems[1].Text;
         if (ed.ShowDialog() == DialogResult.OK)
         {
             attrList.SelectedItems[0].SubItems[1].Text = ed.Value;
         }
     }
 }