diff --git a/ATXTray/ATXTray.csproj b/ATXTray/ATXTray.csproj index 340c1b3cbd4d182d9daf1174601833d15cc4046e..3fcf8f0c648eab9bd7051bff99b5fd50acedb61d 100644 --- a/ATXTray/ATXTray.csproj +++ b/ATXTray/ATXTray.csproj @@ -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> diff --git a/ATXTray/AutoTxTray.cs b/ATXTray/AutoTxTray.cs index 95da906c788bb52683c16aea114acde3bbf89802..c21b0c579302c9eef119e84dfa5795962e024a11 100644 --- a/ATXTray/AutoTxTray.cs +++ b/ATXTray/AutoTxTray.cs @@ -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> diff --git a/ATXTray/packages.config b/ATXTray/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..e06f06e7fa0552bd8975b1b653293aca0059d869 --- /dev/null +++ b/ATXTray/packages.config @@ -0,0 +1,5 @@ +<?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