2
* Xibo - Digitial Signage - http://www.xibo.org.uk
3
* Copyright (C) 2006,2007,2008 Daniel Garner and James Packer
5
* This file is part of Xibo.
7
* Xibo is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Affero General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
12
* Xibo is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU Affero General Public License for more details.
17
* You should have received a copy of the GNU Affero General Public License
18
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
21
using System.Windows.Forms;
25
public class WindowAnimator
39
public WindowAnimator(Form FormToAnimate)
41
window = FormToAnimate;
44
public void WindowFadeIn(int interval, float steps, Direction direction)
51
time.Interval = interval;
52
if (direction == Direction.FadeIn)
54
time.Tick += new EventHandler(Timer_TickIn);
58
time.Tick += new EventHandler(Timer_TickOut);
64
private void Timer_TickIn(object sender, EventArgs e)
66
//Check the Opacity of the form
67
if (window.Opacity != 1.0)
69
//Lower then 1, increment opacity
70
window.Opacity += Step;
74
//We�re finished, stop the timer
82
// There might not be an event handler
87
private void Timer_TickOut(object sender, EventArgs e)
89
//Check the Opacity of the form
90
if (window.Opacity != 0.0)
92
//Lower then 1, increment opacity
93
window.Opacity -= Step;
97
//We�re finished, stop the timer
100
FadeComplete(window);
104
public delegate void FadeCompleteDelegate(Form f);
105
public event FadeCompleteDelegate FadeComplete;
b'\\ No newline at end of file'