Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
7dda7b63
Commit
7dda7b63
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Reduce number of global variables.
Refers to
#2
parent
ff75fc1b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxTray/AutoTxTray.cs
+5
-5
5 additions, 5 deletions
ATxTray/AutoTxTray.cs
with
5 additions
and
5 deletions
ATxTray/AutoTxTray.cs
+
5
−
5
View file @
7dda7b63
...
@@ -24,7 +24,6 @@ namespace ATxTray
...
@@ -24,7 +24,6 @@ namespace ATxTray
private
const
string
AppTitle
=
"AutoTx Tray Monitor"
;
private
const
string
AppTitle
=
"AutoTx Tray Monitor"
;
private
static
readonly
Timer
AppTimer
=
new
Timer
(
1000
);
private
static
readonly
Timer
AppTimer
=
new
Timer
(
1000
);
private
static
bool
_terminate
=
false
;
private
static
string
_statusFile
;
private
static
string
_statusFile
;
private
static
string
_submitPath
;
private
static
string
_submitPath
;
...
@@ -104,9 +103,10 @@ namespace ATxTray
...
@@ -104,9 +103,10 @@ namespace ATxTray
Log
.
Error
(
msg
);
Log
.
Error
(
msg
);
_notifyIcon
.
ShowBalloonTip
(
5000
,
AppTitle
,
msg
,
ToolTipIcon
.
Error
);
_notifyIcon
.
ShowBalloonTip
(
5000
,
AppTitle
,
msg
,
ToolTipIcon
.
Error
);
// we cannot terminate the message loop (Application.Run()) while the constructor
// we cannot terminate the message loop (Application.Run()) while the constructor
// is being run as it is not active yet - therefore we simply remember that we want
// is being run as it is not active yet - therefore we set the _status object to
// to exit and evaluate this in the "Elapsed" handler:
// null which will terminate the application during the next "Elapsed" event:
_terminate
=
true
;
_status
=
null
;
// suspend the thread for 5s to make sure the balloon tip is shown for a while:
System
.
Threading
.
Thread
.
Sleep
(
5000
);
System
.
Threading
.
Thread
.
Sleep
(
5000
);
}
}
...
@@ -192,7 +192,7 @@ namespace ATxTray
...
@@ -192,7 +192,7 @@ namespace ATxTray
}
}
private
void
AppTimerElapsed
(
object
sender
,
ElapsedEventArgs
e
)
{
private
void
AppTimerElapsed
(
object
sender
,
ElapsedEventArgs
e
)
{
if
(
_
terminate
)
{
if
(
_
status
==
null
)
{
AutoTxTrayExit
();
AutoTxTrayExit
();
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment