private void AddClaim(claim c) { int defaultX = 0; int top; if (_controlCount > 0) { top = currentAllControls[_controlCount - 1].Top + currentAllControls[_controlCount - 1].Height + SPACER; } else { top = DEFAULTY; } ctlMultiClaimCallClaimDisplay toAdd; if (_claimCount >= currentClaimControls.Count) { toAdd = new ctlMultiClaimCallClaimDisplay(); toAdd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(211)))), ((int)(((byte)(211))))); toAdd.CurrentCall = null; toAdd.LinkedClaim = null; toAdd.SuspendLayout(); pnlClaimControls.Controls.Add(toAdd); toAdd.Location = new System.Drawing.Point(defaultX, top); toAdd.Name = "ctlMultiClaimCallClaimDisplay" + _claimCount; toAdd.Size = new System.Drawing.Size(pnlClaimControls.Width, 30); toAdd.TabIndex = _claimCount; toAdd.SaveChanges += new System.EventHandler(this.ctlMultiClaimCallClaimDisplay_SaveChanges); toAdd.Maximized += new System.EventHandler(this.ctlMultiClaimCallClaimDisplay_Maximized); toAdd.Minimized += new System.EventHandler(this.ctlMultiClaimCallClaimDisplay_Minimized); toAdd.RequestViewClaim += new EventHandler(toAdd_RequestViewClaim); toAdd.CallStarted += new EventHandler(ctlMultiClaimCallClaimDisplay_CallStarted); toAdd.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; currentClaimControls.Add(toAdd); currentAllControls.Add(toAdd); toAdd.ResumeLayout(); } else { toAdd = currentClaimControls[_claimCount]; currentAllControls.Add(toAdd); toAdd.Visible = true; toAdd.ClearStatus(); } toAdd.SetToMinimizeHeight(); toAdd.LoadClaim(c); _claimCount++; _controlCount++; }
private void ctlMultiClaimCallClaimDisplay_SaveChanges(object sender, EventArgs e) { ctlMultiClaimCallClaimDisplay current = (ctlMultiClaimCallClaimDisplay)sender; if (FormCall == null) { FormCall = GetNewCall(); } current.CurrentCall = FormCall; }
/// <summary> /// Loops through all the shown claims and ends any active calls /// </summary> private void EndAllActiveCalls() { foreach (Control c in currentAllControls) { if (c is ctlMultiClaimCallClaimDisplay) { ctlMultiClaimCallClaimDisplay toEnd = (ctlMultiClaimCallClaimDisplay)c; toEnd.TerminateCall(); } } }