private void btnEditVSS_Click(object sender, System.EventArgs e) { FrmParent.PostActivity(); VideoStorageServerWizard VSSW = new VideoStorageServerWizard(); OysterClassLibrary.VideoStorageServer V = (OysterClassLibrary.VideoStorageServer)lvVSS.SelectedItems[0].Tag; if(V == null) { MessageBox.Show("Error unable to acquire the Video Storage Server for Editing","Unknown Error"); return; } VSSW.Tag = V; DialogResult DR = VSSW.ShowDialog(this); if(DR == DialogResult.OK) { lvVSS.Items.Clear(); FrmParent.LoginUser = FrmParent.OSystem.Refresh(); foreach(OysterClassLibrary.VideoStorageServer VS in FrmParent.OSystem.VIDEOSTORAGESERVERS) { if(UO[4] != VS.ID) { ListViewItem LVI = lvVSS.Items.Add(VS.ControlAddress); LVI.SubItems.Add(VS.ControlPort.ToString()); LVI.Tag = VS; if(VS.ID == V.ID) LVI.Selected = true; } } } VSSW.Dispose(); lvVSS_SelectedIndexChanged(lvVSS,new EventArgs()); }
private void btnNewVSS_Click(object sender, System.EventArgs e) { FrmParent.PostActivity(); VideoStorageServerWizard VSSW = new VideoStorageServerWizard(); DialogResult DR = VSSW.ShowDialog(this); if(DR == DialogResult.OK) { OysterClassLibrary.VideoStorageServer VSS = null; if(lvVSS.SelectedItems.Count != 0) VSS = (OysterClassLibrary.VideoStorageServer)lvVSS.SelectedItems[0].Tag; lvVSS.Items.Clear(); FrmParent.LoginUser = FrmParent.OSystem.Refresh(); foreach(OysterClassLibrary.VideoStorageServer V in FrmParent.OSystem.VIDEOSTORAGESERVERS) { if(UO[4] != V.ID) { ListViewItem LVI = lvVSS.Items.Add(V.ControlAddress); LVI.SubItems.Add(V.ControlPort.ToString()); LVI.Tag = V; if(VSS != null) { if(V.ID == VSS.ID) LVI.Selected = true; } } } } VSSW.Dispose(); lvVSS_SelectedIndexChanged(lvVSS,new EventArgs()); }