/// <summary> /// Displays the specified text and starts the animation. /// </summary> /// <param name="message"></param> private void StartNewSlide(MessageParameters message) { if (!string.IsNullOrEmpty(message.Text)) { currentMessage = message; currentMessage.TextSize = GetTextSize(message.Text); SetControlSize(currentMessage); StartSlideInAnimation(); TriggerPaint(); FlashStrip(); } }
/// <summary> /// If autosize set to true, sets the control size to fit the text. /// </summary> private void SetControlSize(MessageParameters message) { if (this.InvokeRequired) { var del = new Action(() => SetControlSize(message)); this.BeginInvoke(del); } else { if (this.AutoSize) { // Add some padding to the control size to fit animations. this.Size = new Size(message.TextSize.ToSize().Width + animationPadding, message.TextSize.ToSize().Height); } } }
public MessageEventArgs(MessageParameters message) { this.message = message; }