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
e5c0ddd6
Commit
e5c0ddd6
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Be more careful in AtxTray constructor
Fixes
#44
(hopefully!)
parent
f32fc6a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxTray/AutoTxTray.cs
+14
-12
14 additions, 12 deletions
ATxTray/AutoTxTray.cs
with
14 additions
and
12 deletions
ATxTray/AutoTxTray.cs
+
14
−
12
View file @
e5c0ddd6
...
...
@@ -92,8 +92,19 @@ namespace ATxTray
Log
.
Trace
(
"Trying to read service config and status files..."
);
try
{
_config
=
ServiceConfig
.
Deserialize
(
Path
.
Combine
(
baseDir
,
"conf"
));
_submitPath
=
Path
.
Combine
(
_config
.
IncomingPath
,
Environment
.
UserName
);
UpdateStatusInformation
();
SetupContextMenu
();
var
fsw
=
new
FileSystemWatcher
{
Path
=
Path
.
Combine
(
baseDir
,
"var"
),
NotifyFilter
=
NotifyFilters
.
LastWrite
,
Filter
=
"status.xml"
,
};
fsw
.
Changed
+=
StatusFileUpdated
;
fsw
.
EnableRaisingEvents
=
true
;
Log
.
Info
(
"{0} initialization completed."
,
AppTitle
);
}
catch
(
Exception
ex
)
{
var
msg
=
"Error during initialization: "
+
ex
.
Message
;
...
...
@@ -107,21 +118,12 @@ namespace ATxTray
System
.
Threading
.
Thread
.
Sleep
(
5000
);
}
_submitPath
=
Path
.
Combine
(
_config
.
IncomingPath
,
Environment
.
UserName
);
// we need to enable the timer no matter whether the initialization steps above have
// succeeded since this is the only way to cleanly exit the application (by checking
// the _status in the AppTimerElapsed method):
AppTimer
.
Elapsed
+=
AppTimerElapsed
;
AppTimer
.
Enabled
=
true
;
Log
.
Trace
(
"Enabled timer."
);
var
fsw
=
new
FileSystemWatcher
{
Path
=
Path
.
Combine
(
baseDir
,
"var"
),
NotifyFilter
=
NotifyFilters
.
LastWrite
,
Filter
=
"status.xml"
,
};
fsw
.
Changed
+=
StatusFileUpdated
;
fsw
.
EnableRaisingEvents
=
true
;
Log
.
Info
(
"{0} initialization completed."
,
AppTitle
);
}
/// <summary>
...
...
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