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
32e607ca
Commit
32e607ca
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Preliminary code for a folder selection dialog to initiate a transfer.
Refers to
#2
parent
c4500b10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ATXTray/ATXTray.csproj
+13
-0
13 additions, 0 deletions
ATXTray/ATXTray.csproj
ATXTray/AutoTxTray.cs
+20
-1
20 additions, 1 deletion
ATXTray/AutoTxTray.cs
ATXTray/packages.config
+5
-0
5 additions, 0 deletions
ATXTray/packages.config
with
38 additions
and
1 deletion
ATXTray/ATXTray.csproj
+
13
−
0
View file @
32e607ca
...
...
@@ -35,6 +35,18 @@
<ApplicationIcon>
AutoTx.ico
</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"Microsoft.WindowsAPICodePack.ShellExtensions, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Xml.Linq"
/>
...
...
@@ -59,6 +71,7 @@
<AutoGen>
True
</AutoGen>
<DependentUpon>
Resources.resx
</DependentUpon>
</Compile>
<None
Include=
"packages.config"
/>
<None
Include=
"Properties\Settings.settings"
>
<Generator>
SettingsSingleFileGenerator
</Generator>
<LastGenOutput>
Settings.Designer.cs
</LastGenOutput>
...
...
This diff is collapsed.
Click to expand it.
ATXTray/AutoTxTray.cs
+
20
−
1
View file @
32e607ca
...
...
@@ -4,6 +4,7 @@ using System.Timers;
using
System.Drawing
;
using
System.IO
;
using
System.Windows.Forms
;
using
Microsoft.WindowsAPICodePack.Dialogs
;
using
ATXSerializables
;
using
Timer
=
System
.
Timers
.
Timer
;
...
...
@@ -35,6 +36,7 @@ namespace ATXTray
private
readonly
ToolStripMenuItem
_miSvcRunning
=
new
ToolStripMenuItem
();
private
readonly
ToolStripMenuItem
_miSvcSuspended
=
new
ToolStripMenuItem
();
private
readonly
ToolStripMenuItem
_miTxProgress
=
new
ToolStripMenuItem
();
private
readonly
ToolStripMenuItem
_miTxEnqueue
=
new
ToolStripMenuItem
();
public
AutoTxTray
()
{
_notifyIcon
.
Visible
=
true
;
...
...
@@ -70,15 +72,20 @@ namespace ATXTray
_miSvcSuspended
.
Text
=
@"No limits apply, service active."
;
_miSvcSuspended
.
Click
+=
ShowContextMenu
;
_miTxProgress
.
Text
=
"No transfer running."
;
_miTxProgress
.
Text
=
@
"No transfer running."
;
_miTxProgress
.
Click
+=
ShowContextMenu
;
_miTxEnqueue
.
Text
=
@"+++ Add new directory for transfer. +++"
;
_miTxEnqueue
.
Click
+=
_miTxEnqueue_Click
;
_cmStrip
.
Items
.
AddRange
(
new
ToolStripItem
[]
{
_miTitle
,
_miSvcRunning
,
_miSvcSuspended
,
_miTxProgress
,
new
ToolStripSeparator
(),
_miTxEnqueue
,
new
ToolStripSeparator
(),
_miExit
});
...
...
@@ -135,6 +142,18 @@ namespace ATXTray
_notifyIcon
.
ContextMenuStrip
.
Show
();
}
private
void
_miTxEnqueue_Click
(
object
sender
,
EventArgs
e
)
{
var
dirDialog
=
new
CommonOpenFileDialog
{
Title
=
@"Select directory to be transferred"
,
IsFolderPicker
=
true
,
EnsurePathExists
=
true
,
DefaultDirectory
=
_config
.
SourceDrive
};
if
(
dirDialog
.
ShowDialog
()
==
CommonFileDialogResult
.
Ok
)
{
MessageBox
.
Show
(
"Directory selected: "
+
dirDialog
.
FileName
);
}
}
/// <summary>
/// Read (or re-read) the service status file if it has changed since last time.
/// </summary>
...
...
This diff is collapsed.
Click to expand it.
ATXTray/packages.config
0 → 100644
+
5
−
0
View file @
32e607ca
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Microsoft.WindowsAPICodePack-Core"
version
=
"1.1.0.0"
targetFramework
=
"net45"
/>
<
package
id
=
"Microsoft.WindowsAPICodePack-Shell"
version
=
"1.1.0.0"
targetFramework
=
"net45"
/>
</
packages
>
\ No newline at end of file
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