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
5be372cb
Commit
5be372cb
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Use C# 6.0 string interpolation.
parent
3557dc84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ATxCommon/Conv.cs
+1
-1
1 addition, 1 deletion
ATxCommon/Conv.cs
ATxService/AutoTx.cs
+4
-7
4 additions, 7 deletions
ATxService/AutoTx.cs
ATxService/RoboCommand.cs
+1
-2
1 addition, 2 deletions
ATxService/RoboCommand.cs
ATxTray/AutoTxTray.cs
+6
-8
6 additions, 8 deletions
ATxTray/AutoTxTray.cs
with
12 additions
and
18 deletions
ATxCommon/Conv.cs
+
1
−
1
View file @
5be372cb
...
...
@@ -16,7 +16,7 @@
order
++;
numBytes
/=
1024
;
}
return
string
.
Format
(
"{0:0.#} {1}"
,
numBytes
,
suffixes
[
order
]
)
;
return
$"
{
numBytes
:
0
.
#
}
{
suffixes
[
order
]
}
"
;
}
}
}
This diff is collapsed.
Click to expand it.
ATxService/AutoTx.cs
+
4
−
7
View file @
5be372cb
...
...
@@ -111,13 +111,10 @@ namespace ATxService
string
.
IsNullOrWhiteSpace
(
_config
.
AdminEmailAdress
))
return
;
var
subject
=
string
.
Format
(
"{0} - {1} - Admin Notification"
,
ServiceName
,
Environment
.
MachineName
);
var
body
=
string
.
Format
(
"Notification from '{0}' [{1}] (via NLog)\n\n{2}\n\n"
+
"NOTE: log messages of the same level will not be sent via email for the\n"
+
"next {3} minutes, please check the log file on the corresponding host!"
,
_config
.
HostAlias
,
Environment
.
MachineName
,
LogFormatDefault
,
_config
.
AdminNotificationDelta
);
var
subject
=
$"
{
ServiceName
}
-
{
Environment
.
MachineName
}
- Admin Notification"
;
var
body
=
$"Notification from '
{
_config
.
HostAlias
}
' [
{
Environment
.
MachineName
}
] (via NLog)\n\n"
+
$"
{
LogFormatDefault
}
\n\nNOTE: messages of the same log level won't be sent via email for the\n"
+
$"next
{
_config
.
AdminNotificationDelta
}
minutes, please check the corresponding log file!"
;
var
logConfig
=
LogManager
.
Configuration
;
...
...
This diff is collapsed.
Click to expand it.
ATxService/RoboCommand.cs
+
1
−
2
View file @
5be372cb
...
...
@@ -129,8 +129,7 @@ namespace ATxService
// WARNING: RoboSharp doesn't seem to offer a culture invariant representation
// of the FileClass, so this might fail in non-english environments:
if
(
processed
.
FileClass
.
ToLower
().
Equals
(
"new file"
))
{
_transferredFiles
.
Add
(
string
.
Format
(
"{0} ({1})"
,
processed
.
Name
,
Conv
.
BytesToString
(
processed
.
Size
)));
_transferredFiles
.
Add
(
$"
{
processed
.
Name
}
(
{
Conv
.
BytesToString
(
processed
.
Size
)}
)"
);
// reset the value for the amount of bytes transferred for the current file:
_status
.
TransferredBytesCurrentFile
=
0
;
// now add _txCurFileSize (containing either the size of the previously
...
...
This diff is collapsed.
Click to expand it.
ATxTray/AutoTxTray.cs
+
6
−
8
View file @
5be372cb
...
...
@@ -199,7 +199,7 @@ namespace ATxTray
if
((
DateTime
.
Now
-
_status
.
LastStatusUpdate
).
TotalSeconds
<
60
)
heartBeat
=
"OK"
;
if
(
_txInProgress
)
txProgress
=
_tx
Size
.
ToString
();
txProgress
=
_tx
ProgressPct
.
ToString
();
}
UpdateTrayIcon
();
...
...
@@ -207,8 +207,7 @@ namespace ATxTray
if
(!
_statusChanged
)
return
;
UpdateHoverText
(
string
.
Format
(
"AutoTx [svc={0}] [hb={1}] [tx={2}]"
,
serviceRunning
,
heartBeat
,
txProgress
));
UpdateHoverText
(
$"AutoTx [svc=
{
serviceRunning
}
] [hb=
{
heartBeat
}
] [tx=
{
txProgress
}
%]"
);
}
private
void
MiExitClick
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -229,9 +228,9 @@ namespace ATxTray
DefaultDirectory
=
_config
.
SourceDrive
};
if
(
dirDialog
.
ShowDialog
()
==
CommonFileDialogResult
.
Ok
)
{
MessageBox
.
Show
(
"Directory\nselected:\n\n
"
+
dirDialog
.
FileName
+
"
\n\n
WARNING: adding new transfers is NOT YET IMPLEMENTED!"
,
"New transfer confirmation"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
MessageBox
.
Show
(
$@
"Directory\nselected:\n\n
{
dirDialog
.
FileName
}
\n\n"
+
@
"WARNING: adding new transfers is NOT YET IMPLEMENTED!"
,
@
"New transfer confirmation"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
}
}
...
...
@@ -317,8 +316,7 @@ namespace ATxTray
_txInProgress
=
_status
.
TransferInProgress
;
_txSize
=
_status
.
CurrentTransferSize
;
if
(
_txInProgress
)
{
_miTxProgress
.
Text
=
@"Transfer in progress (size: "
+
Conv
.
BytesToString
(
_txSize
)
+
")"
;
_miTxProgress
.
Text
=
$@"Transfer in progress (size:
{
Conv
.
BytesToString
(
_txSize
)}
)"
;
_miTxProgress
.
BackColor
=
Color
.
LightGreen
;
_notifyIcon
.
ShowBalloonTip
(
500
,
AppTitle
,
"New transfer started (size: "
+
...
...
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