Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AxialSqlTools/AxialSqlTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@
<Compile Include="Modules\GridAccess.cs" />
<Compile Include="Modules\KeypressCommandFilter.cs" />
<Compile Include="Modules\MetricsService.cs" />
<Compile Include="Modules\ToolWindowThemeSupport.cs" />
<Compile Include="Modules\VsThemeBrushResolver.cs" />
<Compile Include="Modules\ScriptFactoryAccess.cs" />
<Compile Include="Modules\SettingsManager.cs" />
<Compile Include="Modules\SQLBuilds.cs" />
Expand Down Expand Up @@ -404,6 +406,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\SharedToolWindowTheme.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
Expand Down
67 changes: 43 additions & 24 deletions AxialSqlTools/DataTransfer/DataTransferWindowControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,37 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
mc:Ignorable="d" FontSize="14"
Name="MyToolWindow">
<Grid>
mc:Ignorable="d"
Name="MyToolWindow"
Background="{DynamicResource AxialThemeBackgroundBrush}"
Foreground="{DynamicResource AxialThemeForegroundBrush}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AxialSqlTools;component/Themes/SharedToolWindowTheme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>

<Grid Background="{DynamicResource AxialThemeBackgroundBrush}">
<StackPanel Orientation="Vertical" >

<StackPanel Orientation="Horizontal" Background="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" >
<TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontSize="18">Data Transfer</TextBlock>
<StackPanel Orientation="Horizontal" Background="{DynamicResource AxialThemeHeaderBackgroundBrush}">
<TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Top"
FontWeight="Bold" FontSize="18">
Data Transfer
</TextBlock>
<TextBlock Margin="10" HorizontalAlignment="Left">
<Run Text="Feature description in"/>
<Hyperlink NavigateUri="https://github.com/Axial-SQL/AxialSqlTools/wiki/BULK-Data-Transfer"
RequestNavigate="WikiLink_RequestNavigate">
<Run Text="Wiki"/>
</Hyperlink>
</TextBlock>
</StackPanel>

<Label Content="High-performance data transfer through bulk-load of the active result set." FontWeight="Bold"/>

<StackPanel Orientation="Horizontal" Margin="5,0,5,5">
<Button Content="Edit Saved Connections" Width="180" Height="28" Click="Button_EditSavedConnections_Click"/>
<Button Content="Edit Saved Connections" Width="180" Click="Button_EditSavedConnections_Click"/>
</StackPanel>

<TabControl >
Expand All @@ -27,11 +45,11 @@


<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Select Source from Object Explorer" Click="Button_SelectSource_Click" x:Name="Button_SelectSource" Width="250" FontWeight="Bold"/>
<Button Content="Select Source from Object Explorer" Click="Button_SelectSource_Click" x:Name="Button_SelectSource" Width="250" FontWeight="Bold"/>
<Label Content="Source Description" x:Name="Label_SourceDescription" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Select Target from Object Explorer" x:Name="Button_SelectTarget" Click="Button_SelectTarget_Click" Width="250" FontWeight="Bold"/>
<Button Content="Select Target from Object Explorer" x:Name="Button_SelectTarget" Click="Button_SelectTarget_Click" Width="250" FontWeight="Bold"/>
<Label Content="Target Description" x:Name="Label_TargetDescription" VerticalAlignment="Center"/>
</StackPanel>

Expand Down Expand Up @@ -73,8 +91,8 @@
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Copy Data" Click="ButtonCopyData_Click" Name="Button_CopyData" Margin="5" Width="96" FontWeight="Bold" />
<Button Height="35" Content="Cancel" Click="ButtonCancel_Click" Name="Button_Cancel" Margin="5" Width="76" FontWeight="Bold" />
<Button Content="Copy Data" Click="ButtonCopyData_Click" Name="Button_CopyData" Margin="5" Width="96" FontWeight="Bold" Style="{DynamicResource AxialPrimaryButtonStyle}" />
<Button Content="Cancel" Click="ButtonCancel_Click" Name="Button_Cancel" Margin="5" Width="76" FontWeight="Bold" />
<Label Content="(copy progress)" x:Name="Label_CopyProgress" FontWeight="Bold" VerticalAlignment="Center"/>
</StackPanel>

Expand All @@ -87,7 +105,7 @@
<StackPanel Orientation="Vertical" >

<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Select Source from Object Explorer" Click="Button_SelectSourceToPsql_Click" x:Name="Button_SelectSourceToPsql" Width="250" FontWeight="Bold"/>
<Button Content="Select Source from Object Explorer" Click="Button_SelectSourceToPsql_Click" x:Name="Button_SelectSourceToPsql" Width="250" FontWeight="Bold"/>
<Label Content="Source Description" x:Name="Label_SourceDescriptionToPsql" VerticalAlignment="Center"/>
</StackPanel>

Expand Down Expand Up @@ -143,8 +161,8 @@


<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Copy Data" Click="ButtonToPsql_CopyData_Click" Name="ButtonToPsql_CopyData" Margin="5" Width="96" FontWeight="Bold" />
<Button Height="35" Content="Cancel" Click="ButtonToPsql_Cancel_Click" Name="ButtonToPsql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Button Content="Copy Data" Click="ButtonToPsql_CopyData_Click" Name="ButtonToPsql_CopyData" Margin="5" Width="96" FontWeight="Bold" Style="{DynamicResource AxialPrimaryButtonStyle}" />
<Button Content="Cancel" Click="ButtonToPsql_Cancel_Click" Name="ButtonToPsql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Label Content="(copy progress)" x:Name="Label_CopyProgressToPsql" FontWeight="Bold" VerticalAlignment="Center"/>
</StackPanel>

Expand All @@ -158,7 +176,7 @@
<StackPanel Orientation="Vertical" >

<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Select Source from Object Explorer" Click="Button_SelectSourceToMySql_Click" x:Name="Button_SelectSourceToMySql" Width="250" FontWeight="Bold"/>
<Button Content="Select Source from Object Explorer" Click="Button_SelectSourceToMySql_Click" x:Name="Button_SelectSourceToMySql" Width="250" FontWeight="Bold"/>
<Label Content="Source Description" x:Name="Label_SourceDescriptionToMySql" VerticalAlignment="Center"/>
</StackPanel>

Expand Down Expand Up @@ -214,8 +232,8 @@


<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Copy Data" Click="ButtonToMySql_CopyData_Click" Name="ButtonToMySql_CopyData" Margin="5" Width="96" FontWeight="Bold" />
<Button Height="35" Content="Cancel" Click="ButtonToMySql_Cancel_Click" Name="ButtonToMySql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Button Content="Copy Data" Click="ButtonToMySql_CopyData_Click" Name="ButtonToMySql_CopyData" Margin="5" Width="96" FontWeight="Bold" Style="{DynamicResource AxialPrimaryButtonStyle}" />
<Button Content="Cancel" Click="ButtonToMySql_Cancel_Click" Name="ButtonToMySql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Label Content="(copy progress)" x:Name="Label_CopyProgressToMySql" FontWeight="Bold" VerticalAlignment="Center"/>
</StackPanel>

Expand Down Expand Up @@ -260,7 +278,7 @@
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Select Target from Object Explorer" Click="Button_SelectTargetFromPsql_Click" x:Name="Button_SelectTargetFromPsql" Width="250" FontWeight="Bold"/>
<Button Content="Select Target from Object Explorer" Click="Button_SelectTargetFromPsql_Click" x:Name="Button_SelectTargetFromPsql" Width="250" FontWeight="Bold"/>
<Label Content="Target Description" x:Name="Label_TargetDescriptionFromPsql" VerticalAlignment="Center"/>
</StackPanel>

Expand All @@ -285,8 +303,8 @@


<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Copy Data" Click="ButtonFromPsql_CopyData_Click" Name="ButtonFromPsql_CopyData" Margin="5" Width="96" FontWeight="Bold" />
<Button Height="35" Content="Cancel" Click="ButtonFromPsql_Cancel_Click" Name="ButtonFromPsql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Button Content="Copy Data" Click="ButtonFromPsql_CopyData_Click" Name="ButtonFromPsql_CopyData" Margin="5" Width="96" FontWeight="Bold" Style="{DynamicResource AxialPrimaryButtonStyle}" />
<Button Content="Cancel" Click="ButtonFromPsql_Cancel_Click" Name="ButtonFromPsql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Label Content="(copy progress)" x:Name="Label_CopyProgressFromPsql" FontWeight="Bold" VerticalAlignment="Center"/>
</StackPanel>

Expand Down Expand Up @@ -331,7 +349,7 @@
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Select Target from Object Explorer" Click="Button_SelectTargetFromMySql_Click" x:Name="Button_SelectTargetFromMySql" Width="250" FontWeight="Bold"/>
<Button Content="Select Target from Object Explorer" Click="Button_SelectTargetFromMySql_Click" x:Name="Button_SelectTargetFromMySql" Width="250" FontWeight="Bold"/>
<Label Content="Target Description" x:Name="Label_TargetDescriptionFromMySql" VerticalAlignment="Center"/>
</StackPanel>

Expand All @@ -356,8 +374,8 @@


<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Button Height="35" Content="Copy Data" Click="ButtonFromMySql_CopyData_Click" Name="ButtonFromMySql_CopyData" Margin="5" Width="96" FontWeight="Bold" />
<Button Height="35" Content="Cancel" Click="ButtonFromMySql_Cancel_Click" Name="ButtonFromMySql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Button Content="Copy Data" Click="ButtonFromMySql_CopyData_Click" Name="ButtonFromMySql_CopyData" Margin="5" Width="96" FontWeight="Bold" Style="{DynamicResource AxialPrimaryButtonStyle}" />
<Button Content="Cancel" Click="ButtonFromMySql_Cancel_Click" Name="ButtonFromMySql_Cancel" Margin="5" Width="76" FontWeight="Bold" Visibility="Collapsed" />
<Label Content="(copy progress)" x:Name="Label_CopyProgressFromMySql" FontWeight="Bold" VerticalAlignment="Center"/>
</StackPanel>

Expand All @@ -375,3 +393,4 @@


</UserControl>

24 changes: 24 additions & 0 deletions AxialSqlTools/DataTransfer/DataTransferWindowControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Navigation;

/// <summary>
/// Interaction logic for DataTransferWindowControl.
Expand All @@ -26,6 +28,7 @@ public partial class DataTransferWindowControl : UserControl

private CancellationTokenSource _cancellationTokenSource;
private Stopwatch stopwatch;
private readonly ToolWindowThemeController _themeController;

private string sourceConnectionString = "";
private string targetConnectionString = "";
Expand Down Expand Up @@ -69,6 +72,7 @@ public static int GetRowsCopied(SqlBulkCopy bulkCopy)
public DataTransferWindowControl()
{
this.InitializeComponent();
_themeController = new ToolWindowThemeController(this, ApplyThemeBrushResources);

Button_CopyData.IsEnabled = false;
ButtonToPsql_CopyData.IsEnabled = false;
Expand Down Expand Up @@ -109,6 +113,26 @@ public DataTransferWindowControl()

}

private void ApplyThemeBrushResources()
{
ToolWindowThemeResources.ApplySharedTheme(this);
}

private void WikiLink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
if (string.IsNullOrWhiteSpace(e.Uri?.AbsoluteUri))
{
return;
}

Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)
{
UseShellExecute = true,
});

e.Handled = true;
}

private void Button_EditSavedConnections_Click(object sender, RoutedEventArgs e)
{
var window = new SavedConnectionManagerWindow
Expand Down
Loading