private void UpdateText(string caption, Control displayControl) { if (displayControl != null && displayControl is ICaptionSupport) { ICaptionSupport capControl = displayControl as ICaptionSupport; Title = capControl.Caption; } else if (caption.Length <= 0 && displayControl != null) { Title = displayControl.Text; } else if (caption != null) { Title = caption; } else { Title = string.Empty; } }
private void UpdateText(string caption, Control displayControl) { if (displayControl != null && displayControl is ICaptionSupport) { ICaptionSupport captionSupport = displayControl as ICaptionSupport; this.Title = captionSupport.Caption; return; } if (caption.Length <= 0 && displayControl != null) { this.Title = displayControl.Text; return; } if (caption != null) { this.Title = caption; return; } this.Title = string.Empty; }