private void MediaBufferServerWizard_Load(object sender, System.EventArgs e) { if(this.Owner is System_Properties) FrmParent = (Form1)this.Owner.Owner; else if(this.Owner is Form1) FrmParent = (Form1)this.Owner; else { MessageBox.Show("Illegal open attempt made on Forwarding Server Wizard"); return; } if(this.Tag is OysterClassLibrary.MediaBufferServer) { MBS = (OysterClassLibrary.MediaBufferServer)this.Tag; tbAddress.Text = MBS.Address; tbPort.Text = MBS.Port.ToString(); tbFileDirectory.Text = MBS.StorageDirectory; OysterClassLibrary.Functions F = new OysterClassLibrary.Functions(); OysterClassLibrary.ForwardingServers AF = F.ALLForwardingServers(); F.Dispose(); FSID = new string[AF.Count,2]; int iCount = 0; foreach(OysterClassLibrary.ForwardingServer FS in AF) { FSID[iCount,0] = FS.Address + ":" + FS.Port.ToString(); FSID[iCount,1] = FS.ID.ToString(); cbMBSFS.Items.Add(FSID[iCount,0]); if(FS.ID == MBS.ForwardingServerID) cbMBSFS.Text = FSID[iCount,0]; iCount++; } this.Text = "Editing " + MBS.Address + ":" + MBS.Port.ToString(); } else { this.Text = "Creating New Media Buffer Server"; OysterClassLibrary.Functions F = new OysterClassLibrary.Functions(); OysterClassLibrary.ForwardingServers AF = F.ALLForwardingServers(); FSID = new string[AF.Count,2]; int iCount = 0; int[] UO = F.GetUnassignedObjects(); F.Dispose(); foreach(OysterClassLibrary.ForwardingServer FS in AF) { FSID[iCount,0] = FS.Address + ":" + FS.Port.ToString(); FSID[iCount,1] = FS.ID.ToString(); cbMBSFS.Items.Add(FSID[iCount,0]); if(FS.ID == UO[2]) cbMBSFS.Text = FSID[iCount,0]; iCount++; } } }