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
25965456
Commit
25965456
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Indicate the exit wrapper method by making it an overloaded variant.
parent
e5ce5f92
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
+12
-6
12 additions, 6 deletions
ATxTray/AutoTxTray.cs
with
12 additions
and
6 deletions
ATxTray/AutoTxTray.cs
+
12
−
6
View file @
25965456
...
@@ -133,7 +133,7 @@ namespace ATxTray
...
@@ -133,7 +133,7 @@ namespace ATxTray
private
void
SetupContextMenu
()
{
private
void
SetupContextMenu
()
{
Log
.
Trace
(
"Building context menu..."
);
Log
.
Trace
(
"Building context menu..."
);
_miExit
.
Text
=
@"Exit"
;
_miExit
.
Text
=
@"Exit"
;
_miExit
.
Click
+=
MiExitClick
;
_miExit
.
Click
+=
AutoTxTrayExit
;
_miTitle
.
Font
=
new
Font
(
_cmStrip
.
Font
,
FontStyle
.
Bold
);
_miTitle
.
Font
=
new
Font
(
_cmStrip
.
Font
,
FontStyle
.
Bold
);
_miTitle
.
Text
=
AppTitle
;
_miTitle
.
Text
=
AppTitle
;
...
@@ -176,13 +176,23 @@ namespace ATxTray
...
@@ -176,13 +176,23 @@ namespace ATxTray
_notifyIcon
.
ContextMenuStrip
=
_cmStrip
;
_notifyIcon
.
ContextMenuStrip
=
_cmStrip
;
Log
.
Trace
(
"Finished building context menu."
);
Log
.
Trace
(
"Finished building context menu."
);
}
}
/// <summary>
/// Clean up the tray icon and shut down the application.
/// </summary>
private
void
AutoTxTrayExit
()
{
private
void
AutoTxTrayExit
()
{
_notifyIcon
.
Visible
=
false
;
_notifyIcon
.
Visible
=
false
;
Log
.
Info
(
"Shutting down {0}."
,
AppTitle
);
Log
.
Info
(
"Shutting down {0}."
,
AppTitle
);
Application
.
Exit
();
Application
.
Exit
();
}
}
/// <summary>
/// Wrapper for AutoTxTrayExit to act as an event handler.
/// </summary>
private
void
AutoTxTrayExit
(
object
sender
,
EventArgs
e
)
{
AutoTxTrayExit
();
}
/// <summary>
/// <summary>
/// Update the tooltip making sure not to exceed the 63 characters limit.
/// Update the tooltip making sure not to exceed the 63 characters limit.
/// </summary>
/// </summary>
...
@@ -232,10 +242,6 @@ namespace ATxTray
...
@@ -232,10 +242,6 @@ namespace ATxTray
_statusFileChanged
=
true
;
_statusFileChanged
=
true
;
}
}
private
void
MiExitClick
(
object
sender
,
EventArgs
e
)
{
AutoTxTrayExit
();
}
private
void
ShowContextMenu
(
object
sender
,
EventArgs
e
)
{
private
void
ShowContextMenu
(
object
sender
,
EventArgs
e
)
{
// just show the menu again, to avoid that clicking the menu item closes the context
// just show the menu again, to avoid that clicking the menu item closes the context
// menu without having to disable the item (which would grey out the text and icon):
// menu without having to disable the item (which would grey out the text and icon):
...
...
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