/// <summary>
 /// Edit routing table item.
 /// </summary>
 private void RoutingEditBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (Routing.SelectedItems.Count != 0)
         {
             ListViewItem          li   = Routing.SelectedItems[0];
             GXDLMSRoutingTable    item = (GXDLMSRoutingTable)li.Tag;
             GXDLMSRoutingTableDlg dlg  = new GXDLMSRoutingTableDlg(item);
             if (dlg.ShowDialog(this) == DialogResult.OK)
             {
                 li.SubItems[0].Text = item.DestinationAddress.ToString();
                 li.SubItems[1].Text = item.NextHopAddress.ToString();
                 li.SubItems[2].Text = item.RouteCost.ToString();
                 li.SubItems[3].Text = item.HopCount.ToString();
                 li.SubItems[4].Text = item.WeakLinkCount.ToString();
                 li.SubItems[5].Text = item.ValidTime.ToString();
                 errorProvider1.SetError(Routing, Properties.Resources.ValueChangedTxt);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 /// <summary>
 /// Add new item to routing table.
 /// </summary>
 private void RoutingAddBtn_Click(object sender, EventArgs e)
 {
     try
     {
         GXDLMSRoutingTable    item = new GXDLMSRoutingTable();
         GXDLMSRoutingTableDlg dlg  = new GXDLMSRoutingTableDlg(item);
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             GXDLMSG3Plc6LoWPan target = (GXDLMSG3Plc6LoWPan)Target;
             target.RoutingTable.Add(item);
             ListViewItem li = new ListViewItem(item.DestinationAddress.ToString());
             li.SubItems.Add(item.NextHopAddress.ToString());
             li.SubItems.Add(item.RouteCost.ToString());
             li.SubItems.Add(item.HopCount.ToString());
             li.SubItems.Add(item.WeakLinkCount.ToString());
             li.SubItems.Add(item.ValidTime.ToString());
             li.Tag = item;
             PrefixTable.Items.Add(li);
             errorProvider1.SetError(Routing, Properties.Resources.ValueChangedTxt);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }