-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paito Anderson
committed
Dec 7, 2016
1 parent
b1eede9
commit 1f8702d
Showing
7 changed files
with
113 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
Unofficial Wallcat for Windows | ||
============================== | ||
|
||
![Demo](https://github.com/PaitoAnderson/WallcatWindows/raw/master/demo.gif) | ||
![Demo](https://github.com/PaitoAnderson/WallcatWindows/raw/master/demo.gif) | ||
|
||
![Download Latest](https://github.com/PaitoAnderson/WallcatWindows/releases/latest) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Windows.Forms; | ||
|
||
namespace Wallcat.Util | ||
{ | ||
public class IconAnimation | ||
{ | ||
private readonly Timer _timer = new Timer {Interval = 500}; | ||
private readonly NotifyIcon _notifyIcon; | ||
private int _currentIteration; | ||
private const int Frames = 1; | ||
|
||
public IconAnimation(ref NotifyIcon notifyIcon) | ||
{ | ||
_notifyIcon = notifyIcon; | ||
|
||
// Timer Event | ||
_timer.Tick += (sender, args) => | ||
{ | ||
_currentIteration++; | ||
if (_currentIteration > Frames) _currentIteration = 0; | ||
_notifyIcon.Icon = (_currentIteration == 0) ? Resources.AppIcon : Resources.AppIconAlt; | ||
}; | ||
} | ||
|
||
public void Start() | ||
{ | ||
if (_timer.Enabled == false) | ||
{ | ||
_notifyIcon.Icon = Resources.AppIconAlt; | ||
_currentIteration = 0; | ||
_timer.Start(); | ||
} | ||
} | ||
|
||
public void Stop() | ||
{ | ||
if (_timer.Enabled) | ||
{ | ||
_timer.Stop(); | ||
_notifyIcon.Icon = Resources.AppIcon; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters