private void btnDeleteSE_Click(object sender, System.EventArgs e) { FrmParent.PostActivity(); DialogResult DR = MessageBox.Show("Do you wish to permanently delete this Streaming Encoder?","Confirm permanent deletion",MessageBoxButtons.OKCancel); if(DR == DialogResult.OK) { OysterClassLibrary.StreamingEncoder SE = (OysterClassLibrary.StreamingEncoder)lvSE.SelectedItems[0].Tag; OysterClassLibrary.Functions F = new OysterClassLibrary.Functions(); F.DeleteStreamingEncoder(SE.ID); F.Dispose(); Trace.WriteLine("Deleted Streaming Encoder: " + SE.Description + "(" + SE.ID + ")" ,System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name); lvSE.Items.Clear(); FrmParent.LoginUser = FrmParent.OSystem.Refresh(); bool DidOnce = false; //Reset_All(); foreach(OysterClassLibrary.StreamingEncoder S in FrmParent.OSystem.STREAMINGENCODERS) { if(UO[5] != S.ID) { ListViewItem LVI = lvSE.Items.Add(S.Description); LVI.SubItems.Add(S.CurrentRoom.Description); LVI.Tag = S; if(DidOnce == false) { DidOnce = true; LVI.Selected = true; lvSE_SelectedIndexChanged(lvSE,new EventArgs()); } } } } }