Skip to content

Commit

Permalink
Update to 1.0.3 GUI Update
Browse files Browse the repository at this point in the history
  • Loading branch information
biteworks committed Jan 11, 2021
1 parent 8d5f02b commit aa1576a
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 16 deletions.
3 changes: 2 additions & 1 deletion CopyFolderTool/CopyFolderTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon-CopyFolderTool.ico</ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down
25 changes: 18 additions & 7 deletions CopyFolderTool/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CopyFolderTool"
mc:Ignorable="d"
Title="CopyFolderTool" Height="400" Width="420" Background="#FFD1D1D1" ResizeMode="NoResize" Icon="Icon-CopyFolderTool.ico">
Title="CopyFolderTool" Height="400" Width="420" Background="#FFD1D1D1" Icon="Icon-CopyFolderTool.ico">
<StackPanel Margin="10">
<Label FontWeight="Bold">Source Folder</Label>
<TextBox Name="fieldSource" Margin="5" Padding="3"/>
<Grid HorizontalAlignment="Stretch" DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Name="fieldSource" Margin="5" Padding="3" Grid.Column="0" HorizontalAlignment="Stretch"/>
<Button Name="buttonSourcePath" Content=". . ." Margin="5" Click="selectDestinationFolder" Padding="3" Width="38" HorizontalAlignment="Right" ToolTip="Select Folder" Grid.Column="1"/>
</Grid>

<Label FontWeight="Bold">Destination Folder</Label>
<DockPanel HorizontalAlignment="Left" Width="400">
<TextBox Name="fieldDestination" Margin="5" Padding="3" Width="330"/>
<Button Content=". . ." Margin="5" Click="selectDestinationFolder" Padding="3" Width="38" HorizontalAlignment="Left" ToolTip="Select Folder"/>
</DockPanel>
<Grid HorizontalAlignment="Stretch" DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Name="fieldDestination" Margin="5" Padding="3" Grid.Column="0" HorizontalAlignment="Stretch"/>
<Button Name="buttonDestinationPath" Content=". . ." Margin="5" Click="selectDestinationFolder" Padding="3" Width="38" HorizontalAlignment="Right" ToolTip="Select Folder" Grid.Column="1"/>
</Grid>

<Label FontWeight="Bold">Copy Options</Label>
<CheckBox IsChecked="True" Name="option_E" Margin="5">Copy subfolders</CheckBox>
Expand All @@ -25,6 +36,6 @@
<CheckBox Name="option_Shutdown" Margin="5">Shutdown the computer after copying</CheckBox>

<Button Name="btn_startCopying" Content="Start copying" Margin="5,20,5,5" Click="copyToServer" Padding="3"/>
<TextBlock Margin="5" IsEnabled="False" Opacity="0.5" HorizontalAlignment="Right">Version 1.0.2</TextBlock>
<TextBlock Margin="5" IsEnabled="False" Opacity="0.5" HorizontalAlignment="Right">Version 1.0.3</TextBlock>
</StackPanel>
</Window>
14 changes: 13 additions & 1 deletion CopyFolderTool/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,24 @@ private void copyToServer(object sender, RoutedEventArgs e)

private void selectDestinationFolder(object sender, RoutedEventArgs e)
{
var button = sender as System.Windows.Controls.Button;
var dialog = new CommonOpenFileDialog();
dialog.IsFolderPicker = true;

if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
{
fieldDestination.Text = dialog.FileName;
switch (button.Name)
{
case "buttonSourcePath":
fieldSource.Text = dialog.FileName;
break;
case "buttonDestinationPath":
fieldDestination.Text = dialog.FileName;
break;
default:
Console.WriteLine("Wrong Button");
break;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions CopyFolderTool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: AssemblyVersion("1.0.0.3")]
[assembly: AssemblyFileVersion("1.0.0.3")]
4 changes: 2 additions & 2 deletions _install/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
SET InstallDirectory="C:\Tools\CopyFolderTool\"
SET CopyToFolder="%~dp0Executables\"

ECHO 1. Check for "C:/Tools" folder
ECHO 1. Check for "C:\Tools\CopyFolderTool\" folder
IF NOT EXIST %InstallDirectory%NUL MKDIR %InstallDirectory%
ECHO.

ECHO 2. Copy files to directory
ROBOCOPY %CopyToFolder% %InstallDirectory% /XO /E
COPY %CopyToFolder% %InstallDirectory%
ECHO.

ECHO 3. Registry entry will be set (needs admin rights)
Expand Down
2 changes: 1 addition & 1 deletion _install/uninstall.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@ECHO OFF
SET InstallDirectory="C:\Tools\CopyFolderTool\"

ECHO 1. Remove "C:/Tools/CopyFolderTool" folder
ECHO 1. Remove "C:\Tools\CopyFolderTool\" folder
RMDIR /Q /S %InstallDirectory%
ECHO ...Done
ECHO.
Expand Down
4 changes: 2 additions & 2 deletions _install/update.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
SET InstallDirectory="C:\Tools\CopyFolderTool\"
SET CopyToFolder="%~dp0Executables\"

ECHO 1. Check for "C:/Tools" folder
ECHO 1. Check for "C:\Tools\CopyFolderTool\" folder
IF NOT EXIST %InstallDirectory%NUL MKDIR %InstallDirectory%
ECHO.

ECHO 2. Update files in directory
ROBOCOPY %CopyToFolder% %InstallDirectory% /XO /E
COPY %CopyToFolder% %InstallDirectory%
ECHO ...Done
ECHO.

Expand Down

0 comments on commit aa1576a

Please sign in to comment.