Importdialog geradegezogen
This commit is contained in:
parent
77ae4a7c40
commit
ab357ff88d
@ -821,6 +821,8 @@
|
||||
<Resource Include="Resources\Logo.gif" />
|
||||
<Resource Include="Resources\excel.png" />
|
||||
<Resource Include="Resources\logo_eni.png" />
|
||||
<Resource Include="Resources\import1.png" />
|
||||
<Resource Include="Resources\import2.png" />
|
||||
<Content Include="x64\SQLite.Interop.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
@ -8,28 +8,36 @@
|
||||
xmlns:p="clr-namespace:ENI2.Properties"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
mc:Ignorable="d"
|
||||
Title="{x:Static p:Resources.textCompareExcel}" Height="200" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_grey.ico">
|
||||
Title="{x:Static p:Resources.textCompareExcel}" Height="260" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_grey.ico">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="32" />
|
||||
<RowDefinition Height="60" />
|
||||
<RowDefinition Height="60" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="60" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label VerticalAlignment="Center" Grid.Row="0" Grid.Column="0">
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" TextWrapping="Wrap" HorizontalAlignment="Center" TextAlignment="Center">Drop your Excel file here</TextBlock>
|
||||
<Label VerticalAlignment="Center" Grid.Row="1" Grid.Column="0">
|
||||
<AccessText TextWrapping="Wrap">
|
||||
First (original) sheet
|
||||
</AccessText>
|
||||
</Label>
|
||||
<Image x:Name="imageSource" Grid.Row="0" Grid.Column="1" Margin="2" Source="../Resources/trafficlight_off.png" AllowDrop="True" Drop="imageSource_Drop" DragEnter="imageSource_DragEnter"/>
|
||||
<Label VerticalAlignment="Center" Grid.Row="1" Grid.Column="0">
|
||||
<Image x:Name="imageSource" Grid.Row="1" Grid.Column="1" Margin="4" Source="../Resources/import2.png" AllowDrop="True" Drop="imageSource_Drop" DragEnter="imageSource_DragEnter"/>
|
||||
<TextBox TextWrapping="Wrap" x:Name="textBoxSource" Grid.Row="1" Grid.Column="2" IsReadOnly="True" Margin="2" Drop="imageSource_Drop" AllowDrop="True" DragEnter="imageSource_DragEnter"/>
|
||||
|
||||
<Label VerticalAlignment="Center" Grid.Row="2" Grid.Column="0">
|
||||
<AccessText TextWrapping="Wrap">
|
||||
Second (updated) sheet
|
||||
</AccessText>
|
||||
</Label>
|
||||
<Image x:Name="imageTarget" Grid.Row="1" Grid.Column="1" Margin="2" Source="../Resources/trafficlight_off.png" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter"/>
|
||||
<Image x:Name="imageTarget" Grid.Row="2" Grid.Column="1" Margin="4" Source="../Resources/import1.png" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter"/>
|
||||
<TextBox TextWrapping="Wrap" x:Name="textBoxTarget" Grid.Row="2" Grid.Column="2" IsReadOnly="True" Margin="2" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter"/>
|
||||
|
||||
<Button x:Name="buttonCompare" Margin="2" Grid.Row="3" Grid.Column="1" Content="Compare" IsEnabled="False" Click="buttonCompare_Click"/>
|
||||
</Grid>
|
||||
</enictrl:StatusWindowBase>
|
||||
|
||||
@ -30,17 +30,20 @@ namespace ENI2.EditControls
|
||||
if(files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
||||
{
|
||||
_sourcePath = files[0];
|
||||
imageSource.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_green.png"));
|
||||
textBoxSource.Text = _sourcePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
imageSource.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_yellow.png"));
|
||||
textBoxSource.Text = null;
|
||||
_sourcePath = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
imageSource.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_red.png"));
|
||||
textBoxSource.Text = null;
|
||||
_sourcePath = null;
|
||||
}
|
||||
EnableCompareButton();
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,23 +59,39 @@ namespace ENI2.EditControls
|
||||
if (files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
||||
{
|
||||
_targetPath = files[0];
|
||||
imageTarget.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_green.png"));
|
||||
textBoxTarget.Text = _targetPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
imageTarget.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_yellow.png"));
|
||||
_targetPath = null;
|
||||
textBoxTarget.Text = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
imageTarget.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_red.png"));
|
||||
_targetPath = null;
|
||||
textBoxTarget.Text = null;
|
||||
}
|
||||
EnableCompareButton();
|
||||
}
|
||||
}
|
||||
|
||||
private void imageSource_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effects = DragDropEffects.Copy;
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
e.Effects = DragDropEffects.Copy;
|
||||
}
|
||||
}
|
||||
|
||||
private void EnableCompareButton()
|
||||
{
|
||||
this.buttonCompare.IsEnabled = (_targetPath != null) && (_sourcePath != null);
|
||||
}
|
||||
|
||||
private void buttonCompare_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
ENI2/Properties/Resources.Designer.cs
generated
20
ENI2/Properties/Resources.Designer.cs
generated
@ -500,6 +500,26 @@ namespace ENI2.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap import1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("import1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap import2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("import2", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@ -1843,4 +1843,10 @@
|
||||
<data name="textCompareExcel" xml:space="preserve">
|
||||
<value>Compare excel sheets</value>
|
||||
</data>
|
||||
<data name="import1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\import1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="import2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\import2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
ENI2/Resources/import1.png
Normal file
BIN
ENI2/Resources/import1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
ENI2/Resources/import2.png
Normal file
BIN
ENI2/Resources/import2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Loading…
Reference in New Issue
Block a user