/// <summary> /// /// </summary> /// <param name="title"></param> /// <param name="body"></param> /// <param name="duration"></param> /// <param name="animation"></param> /// <param name="direction"></param> public FixedNotification(string title, string body, FormAnimator.AnimationMethod animation, FormAnimator.AnimationDirection direction) { InitializeComponent(); labelTitle.Text = title; labelBody.Text = body; _animator = new FormAnimator(this, animation, direction, 500); Region = Region.FromHrgn(NativeMethods.CreateRoundRectRgn(0, 0, Width - 5, Height - 5, 20, 20)); }
/// <summary> /// /// </summary> /// <param name="title"></param> /// <param name="body"></param> /// <param name="duration"></param> /// <param name="animation"></param> /// <param name="direction"></param> public Notification(string title, string body, int duration, FormAnimator.AnimationMethod animation, FormAnimator.AnimationDirection direction) { InitializeComponent(); if (duration < 0) { duration = int.MaxValue; } lifeTimer.Interval = duration; labelTitle.Text = title; labelBody.Text = body; _animator = new FormAnimator(this, animation, direction, 500); Region = Region.FromHrgn(NativeMethods.CreateRoundRectRgn(0, 0, Width - 5, Height - 5, 20, 20)); }