コード例 #1
0
 private void mnuChange_Click(object sender, EventArgs e)
 {
     if (list.SelectedItems.Count == 1)
     {
         MagiWolDocument.Address currDestination = (MagiWolDocument.Address)list.SelectedItems[0];
         using (var frm = new DetailForm(currDestination)) {
             if (frm.ShowDialog(this) == DialogResult.OK)
             {
                 currDestination = frm.Destination;
                 UpdateData(new MagiWolDocument.Address[] { currDestination });
             }
         }
     }
 }
コード例 #2
0
 private void mnuAdd_Click(object sender, EventArgs e)
 {
     using (var frm = new DetailForm(null)) {
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             if (this.Document.HasAddress(frm.Destination))
             {
                 if (Medo.MessageBox.ShowQuestion(this, string.Format("MAC address \"{0}\" is already in list.\nDo you wish to add it anyhow?", frm.Destination.Mac), MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     this.Document.AddAddress(frm.Destination, true);
                 }
             }
             else
             {
                 this.Document.AddAddress(frm.Destination, false);
             }
             UpdateData(new MagiWolDocument.Address[] { frm.Destination });
         }
     }
 }