This commit is contained in:
Maddo 2016-11-07 16:20:31 +01:00
commit 7117b2e4a8
13 changed files with 834 additions and 675 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
</configuration>
</configuration>

View file

@ -1,5 +1,5 @@
<Application x:Class="WPFCatalog.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006">
<Application.Resources>
<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" xmlns:vm="clr-namespace:WPFCatalog.ViewModel" />
<!--<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" xmlns:vm="clr-namespace:WPFCatalog.ViewModel" />-->
</Application.Resources>
</Application>

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

View file

@ -5,12 +5,11 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wpfCatalog="clr-namespace:WPFCatalog"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}"
Title="Image Catalog" Height="466" Width="772"
d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}"
>
<!--d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}"-->
<Window.Resources>
<Style x:Key="CommonStyle" TargetType="FrameworkElement">
<Setter Property="Margin" Value="4" />
@ -66,26 +65,35 @@
<ColumnDefinition />
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Sorgente"/>
<TextBox Grid.Row="0" Grid.Column="1" x:Name="txtSorgente" Margin="0,5" Text="{Binding DirSorgente}" />
<Button Grid.Row="0" Grid.Column="2" x:Name="btnOpenSorgente" Margin="5,5" Command="{Binding OpenSorgenteCommand}">
<Button Grid.Row="0" Grid.Column="2" x:Name="btnSelectSorgente" Margin="5,5" Command="{Binding SelectSourceFolderCommand}">
<Button.Content>
<Image Source="Icons/document-open-6.png" />
</Button.Content>
</Button>
<Button Grid.Row="0" Grid.Column="3" x:Name="btnOpenSorgente" Margin="5,5" Command="{Binding OpenSourceFolderCommand}">
<Button.Content>
<Image Source="Icons/document-open-folder.png" />
</Button.Content>
</Button>
<Label Grid.Row="1" Grid.Column="0" Content="Destinazione"/>
<TextBox Grid.Row="1" Grid.Column="1" x:Name="txtDestinazione" Margin="0,5" Text="{Binding DirDestinazione}"/>
<Button Grid.Row="1" Grid.Column="2" x:Name="btnOpenDestinazione" Margin="5,5" Command="{Binding OpenDestinazioneCommand}">
<Button Grid.Row="1" Grid.Column="2" x:Name="btnSelectDestinazione" Margin="5,5" Command="{Binding SelectDestinationFolderCommand}">
<Button.Content>
<Image Source="Icons/document-open-6.png" />
</Button.Content>
</Button>
<Button Grid.Row="1" Grid.Column="3" x:Name="btnOpenDestinazione" Margin="5.4,0,4.6,4.6" Command="{Binding OpenDestinationFolderCommand}" Height="19" VerticalAlignment="Bottom">
<Button.Content>
<Image Source="Icons/document-open-folder.png" />
</Button.Content>
</Button>
<CheckBox Grid.Row="2" Grid.Column="1" Content="Aggiorna le sottodirectory" x:Name="chkAggiornaSottodirectory" IsChecked="{Binding DirAggiornaSottoDirectory}"/>
</Grid>
@ -93,7 +101,7 @@
</GroupBox>
<GroupBox Header="Generale" Margin="2">
<StackPanel Orientation="Vertical" >
<CheckBox Content="Aggiorna JPG" x:Name="chkForzaJPG" IsChecked="{Binding GeneraleForzaJpg}" Margin="2"/>
<CheckBox Content="Aggiorna JPG" x:Name="chkForzaJPG" IsChecked="{Binding GeneraleForzaJPG}" Margin="2"/>
<CheckBox Content="Rotazione Automatica" x:Name="chkRotazioneAutomatica" IsChecked="{Binding GeneraleRotazioneAutomatica}" Margin="2"/>
<CheckBox Content="Sovrascrivi File" x:Name="chkSovrascriviFile" IsChecked="{Binding GeneraleSovrascriviFile}" Margin="2"/>
</StackPanel>
@ -199,7 +207,8 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Font"/>
<ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Width="100" HorizontalAlignment="Right" SelectedItem="{Binding CarattereFont}" /> <!--todo-->
<ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Width="100" HorizontalAlignment="Right" SelectedItem="{Binding CarattereFont}" />
<!--todo-->
<CheckBox Grid.Row="0" Grid.Column="3" Content="Grassetto" VerticalAlignment="Center" IsChecked="{Binding CarattereGrassetto}" />
@ -278,7 +287,8 @@
<TextBox Grid.Row="0" Grid.Column="2" Text="{Binding TestoApplicareTrasparenza}" />
<Label Grid.Row="1" Grid.Column="0" Content="Posizione" />
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" /> <!--ToDo-->
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" />
<!--ToDo-->
<CheckBox Grid.Row="2" Grid.Column="1" Content="Orario" IsChecked="{Binding TestoApplicareOrario}"/>
<CheckBox Grid.Row="2" Grid.Column="2" Content="Tempo Gara" IsChecked="{Binding TestoApplicareTempoGaraCheck}"/>
@ -292,7 +302,8 @@
<TextBox Grid.Row="1" Grid.Column="6" Grid.ColumnSpan="2" Text="{Binding TestoApplicareAllineamento}"/>
<Label Grid.Row="2" Grid.Column="5" Content="Partenza" />
<ComboBox Grid.Row="2" Grid.Column="6" Grid.ColumnSpan="2" /> <!--todo-->
<ComboBox Grid.Row="2" Grid.Column="6" Grid.ColumnSpan="2" />
<!--todo-->
</Grid>
</StackPanel>
</GroupBox>
@ -392,10 +403,12 @@
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoMargine}" />
<Label Grid.Row="5" Grid.Column="0" Content="Posizione Orizzontale" />
<ComboBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" /> <!--todo-->
<ComboBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" />
<!--todo-->
<Label Grid.Row="6" Grid.Column="0" Content="Posizione Verticale" />
<ComboBox Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" /> <!--todo-->
<ComboBox Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" />
<!--todo-->
<Label Grid.Row="7" Grid.Column="0" Content="Colore Trasparente" />
<Image Grid.Row="7" Grid.Column="1" Width="24" Height="24" HorizontalAlignment="Left" />
@ -411,7 +424,14 @@
</TabControl>
<StackPanel DockPanel.Dock="Right" Orientation="Vertical">
<GroupBox DockPanel.Dock="Right" Header="Statistiche">
<Button Content="STOP" Width="192" Command="{Binding StopCommand}"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Button Content="Carica Impostazioni" Command="{Binding ImportSettingsCommand}"></Button>
<Button Content="Salva Impostazioni" Command="{Binding ExportSettingsCommand}" ></Button>
</StackPanel>
<Button Content="Start"></Button>
<Button Content="STOP" Command="{Binding StopCommand}"/>
</StackPanel>
</GroupBox>
</StackPanel>

View file

@ -1,22 +1,103 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CatalogLib;
using GalaSoft.MvvmLight.Command;
using MaddoLibrary.Helpers;
namespace WPFCatalog
{
public class MainWindowViewModel : ViewModelBase
{
public PicSettings PicSettings { get; set; }
public PicSettings PicSettings
{
get { return PicSettings.Instance; }
}
public MainWindowViewModel()
{
PicSettings = new PicSettings();
//PicSettings = new PicSettings();
RegisterCommands();
}
// todo: comandi e serializzazione
#region commands
public RelayCommand ExportSettingsCommand { get; private set; }
public RelayCommand SelectSourceFolderCommand { get; private set; }
public RelayCommand SelectDestinationFolderCommand { get; private set; }
public RelayCommand OpenSourceFolderCommand { get; private set; }
public RelayCommand OpenDestinationFolderCommand { get; private set; }
private void RegisterCommands()
{
ExportSettingsCommand = new RelayCommand(ExportSettings);
SelectSourceFolderCommand = new RelayCommand(SelectSourceFolder);
OpenSourceFolderCommand = new RelayCommand(OpenSourceFolder);
SelectDestinationFolderCommand = new RelayCommand(SelectDestinationFolder);
OpenDestinationFolderCommand = new RelayCommand(OpenDestinationFolder);
}
private void OpenSourceFolder()
{
if (Directory.Exists(DirSorgente))
{
Process.Start("explorer.exe", DirSorgente);
}
}
private void OpenDestinationFolder()
{
if (Directory.Exists(DirDestinazione))
{
Process.Start("explorer.exe", DirDestinazione);
}
}
private void SelectSourceFolder()
{
var a = FileHelper.GetOpenFolderPath();
if (!string.IsNullOrWhiteSpace(a))
{
this.DirSorgente = a;
}
}
private void SelectDestinationFolder()
{
var a = FileHelper.GetOpenFolderPath();
if (!string.IsNullOrWhiteSpace(a))
{
this.DirDestinazione = a;
}
}
private void ExportSettings()
{
string s = PicSettings.SerializeSettings();
DialogHelper.PopUpAlert(s, "data");
}
#endregion
#region Proprietà
public PicSettings SettingsString
@ -26,42 +107,46 @@ namespace WPFCatalog
public string DirSorgente
{
get { return PicSettings.GetString("dirSorgente"); }
set { PicSettings.Set("dirSorgente", value); }
get { return PicSettings.GetString("DirSorgente"); }
set { PicSettings.Set("DirSorgente", value); RaisePropertyChanged("DirSorgente"); }
}
public string DirDestinazione
{
get { return PicSettings.GetString("dirDestinazione"); }
get { return PicSettings.DirectoryDestinazione; }
set
{
PicSettings.Set("dirDestinazione", value);
PicSettings.Set("DirDestinazione", value);
RaisePropertyChanged("DirDestinazione");
}
}
public bool DirSottoDirectory
public bool DirAggiornaSottoDirectory
{
get { return PicSettings.GetBool("dirSottoDirectory"); }
get { return PicSettings.DirAggiornaSottoDirectory; }
set
{
PicSettings.Set("dirSottoDirectory", value);
RaisePropertyChanged("DirSottoDirectory");
PicSettings.DirAggiornaSottoDirectory = value;
RaisePropertyChanged("DirAggiornaSottoDirectory");
}
}
public bool SubdirCreaSottoCartelle
{
get { return true; }
set { }// temp
//get { return PicSettings.GetBool("")}
}
public string DirDividiNumFile { get { return PicSettings.GetString("dirDividiNumFile"); } set { PicSettings.Set("dirDividiNumFile", value); } }
public string DirDividiSuffisso { get { return PicSettings.GetString("dirDividiSuffisso"); } set { PicSettings.Set("dirDividiSuffisso", value); } }
public string DirDividiNumCifre { get { return PicSettings.GetString("dirDividiNumCifre"); } set { PicSettings.Set("dirDividiNumCifre", value); RaisePropertyChanged("DirDividiNumCifre");} }
public string DirDividiNumCifre { get { return PicSettings.GetString("dirDividiNumCifre"); } set { PicSettings.Set("dirDividiNumCifre", value); RaisePropertyChanged("DirDividiNumCifre"); } }
public bool DirDividiDestinazione { get { return PicSettings.GetBool("dirDividiDestinazione"); } set { PicSettings.Set("dirDividiDestinazione", value); } }
public bool DirDividiTipoNumerazioneProg { get { return PicSettings.GetString("DirDividiTipoNumerazione").ToUpper() == "PROGRESSIVA"; } set { if (value == true) PicSettings.Set("DirDividiTipoNumerazione", "PROGRESSIVA"); } }
public bool DirDividiTipoNumerazioneFile { get { return PicSettings.GetString("DirDividiTipoNumerazione").ToUpper() == "FILES"; } set { if (value == false) PicSettings.Set("DirDividiTipoNumerazione", "FILES"); } }
public bool MiniatureCrea { get { return PicSettings.GetBool("miniatureCrea"); } set { PicSettings.Set("miniatureCrea",value); RaisePropertyChanged("MiniatureCrea");} }
public bool MiniatureCrea { get { return PicSettings.GetBool("miniatureCrea"); } set { PicSettings.Set("miniatureCrea", value); RaisePropertyChanged("MiniatureCrea"); } }
public string MiniatureSuffisso
{
@ -333,32 +418,32 @@ namespace WPFCatalog
}
}
public bool GeneraleForzaJpg
public bool GeneraleForzaJPG
{
get { return PicSettings.GetBool("generaleForzaJpg"); }
get { return PicSettings.GeneraleForzaJPG; }
set
{
PicSettings.Set("generaleForzaJpg", value);
RaisePropertyChanged("GeneraleForzaJpg");
PicSettings.GeneraleForzaJPG = value;
RaisePropertyChanged("GeneraleForzaJPG");
}
}
public bool GeneraleRotazioneAutomatica
{
get { return PicSettings.GetBool("generaleRotazioneAutomatica"); }
get { return PicSettings.GeneraleRotazioneAutomatica; }
set
{
PicSettings.Set("generaleRotazioneAutomatica", value);
PicSettings.GeneraleRotazioneAutomatica = value;
RaisePropertyChanged("GeneraleRotazioneAutomatica");
}
}
public bool GeneraleSovrascriviFile
{
get { return PicSettings.GetBool("generaleSovrascriviFile"); }
get { return PicSettings.GeneraleSovrascriviFile; }
set
{
PicSettings.Set("generaleSovrascriviFile", value);
PicSettings.GeneraleSovrascriviFile = value;
RaisePropertyChanged("GeneraleSovrascriviFile");
}
}

View file

@ -1,17 +1,17 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18052
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WPFCatalog.Properties
{
namespace WPFCatalog.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -22,48 +22,40 @@ namespace WPFCatalog.Properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFCatalog.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}

View file

@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18052
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WPFCatalog.Properties
{
namespace WPFCatalog.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WPFCatalog</RootNamespace>
<AssemblyName>WPFCatalog</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
@ -17,6 +17,7 @@
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -166,6 +167,13 @@
<Project>{d27accf2-80fc-4de8-aeb8-351ff076e6d5}</Project>
<Name>CatalogLib</Name>
</ProjectReference>
<ProjectReference Include="..\MaddoLibrary\MaddoLibrary.WPF.NET46\MaddoLibrary.WPF.NET46.csproj">
<Project>{73da19d7-196d-4b16-b610-93250978a607}</Project>
<Name>MaddoLibrary.WPF.NET46</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\document-open-folder.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.