void OnShiftAnimation(FloatAnimationInfo finfo) { double newValue = finfo.Value * Height; double delta = newValue - PrevShiftValue; if (delta < 1.0) { return; } PrevShiftValue = newValue; foreach (NotificationForm form in OpenedForms) { if (form == this) { break; } form.TopLocation -= (int)(delta); form.Top = form.TopLocation; } while (OpenedForms.Count > 0 && OpenedForms.First().Bottom < 0) { OpenedForms.First().Hide(); OpenedForms.RemoveAt(0); } }
public void HideInfo() { FloatAnimationInfo info = new FloatAnimationInfo(this, this, 1000, 1.0f, 0.0f, true); XtraAnimator.Current.AddAnimation(info); ShouldHide = true; }
void ShiftUpOpenedForms() { PrevShiftValue = 0; FloatAnimationInfo info = new FloatAnimationInfo(this, ShiftAnimationId, 300, 0.0f, 1.0f, true); XtraAnimator.Current.AddAnimation(info); }
void IXtraAnimationListener.OnAnimation(BaseAnimationInfo info) { FloatAnimationInfo finfo = (FloatAnimationInfo)info; Location = new Point((int)(StartBounds.X + finfo.Value * (DestinationBounds.X - StartBounds.X)), DestinationBounds.Y);; Opacity = finfo.Value; }
void IXtraAnimationListener.OnAnimation(BaseAnimationInfo info) { FloatAnimationInfo finfo = (FloatAnimationInfo)info; if (finfo.AnimationId == ShiftAnimationId) { OnShiftAnimation(finfo); } else { OnAppearAnimation(finfo); } }
protected virtual void ShowInfoAnimated() { Point location = Point.Empty; if (OwnerControl != null) { Rectangle rect = OwnerControl.RectangleToScreen(OwnerControl.ClientRectangle); DestinationBounds = new Rectangle(rect.Right - Width, rect.Bottom - Height, Width, Height); } else { Screen screen = Screen.FromControl(OwnerForm); DestinationBounds = new Rectangle(screen.WorkingArea.Right - Width, screen.WorkingArea.Bottom - Height, Width, Height); } StartBounds = new Rectangle(DestinationBounds.X + Offset, DestinationBounds.Y, DestinationBounds.Width, DestinationBounds.Height); Opacity = 0.0f; Visible = true; Bounds = StartBounds; FloatAnimationInfo info = new FloatAnimationInfo(this, this, 1000, 0.0f, 1.0f, true); XtraAnimator.Current.AddAnimation(info); }
void OnEndShiftAnimationId(FloatAnimationInfo floatAnimationInfo) { }
void OnAppearAnimation(FloatAnimationInfo finfo) { Location = new Point((int)(StartBounds.X + finfo.Value * (DestinationBounds.X - StartBounds.X)), TopLocation); Opacity = finfo.Value; }