diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-23 16:13:41 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-23 16:13:41 +0300 |
| commit | ba4aec4c691476d68b3da383a70bff42341c7171 (patch) | |
| tree | cff1ec9b2b4c6bc09ceb4d2a7a64f8cf1e6a8fc0 /Software/Visual_Studio/Tango.Core/Threading | |
| parent | 2c48f9ef5ee4978f531e18d0c5945f33705bfe46 (diff) | |
| download | Tango-ba4aec4c691476d68b3da383a70bff42341c7171.tar.gz Tango-ba4aec4c691476d68b3da383a70bff42341c7171.zip | |
Implemented screen lock for PPC.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/Threading')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs b/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs index 48ee12964..f16e7739c 100644 --- a/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs +++ b/Software/Visual_Studio/Tango.Core/Threading/ActionTimer.cs @@ -10,7 +10,7 @@ namespace Tango.Core.Threading /// <summary> /// Represents an action executer with a predefined interval and a reset mechanism. /// </summary> - public class ActionTimer + public class ActionTimer : IDisposable { private Timer _timer; private Action _action; @@ -43,5 +43,17 @@ namespace Tango.Core.Threading _timer.Stop(); _action?.Invoke(); } + + /// <summary> + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// </summary> + public void Dispose() + { + if (_timer != null) + { + _timer.Stop(); + _timer = null; + } + } } } |
