Again
This commit is contained in:
parent
68085e6157
commit
7117b2e4a8
13 changed files with 834 additions and 675 deletions
16
Catalog.sln
16
Catalog.sln
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ImageCatalog 2", "imagecatalog\ImageCatalog 2.vbproj", "{8D3AA2B0-8F06-4A61-9CAD-B920EB1A8E9C}"
|
||||
EndProject
|
||||
|
|
@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFCatalog", "WPFCatalog\WP
|
|||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CatalogVbLib", "CatalogVbLib\CatalogVbLib.vbproj", "{44465926-240D-473F-90B8-786BA4384406}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaddoLibrary.WPF.NET46", "MaddoLibrary\MaddoLibrary.WPF.NET46\MaddoLibrary.WPF.NET46.csproj", "{73DA19D7-196D-4B16-B610-93250978A607}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -67,6 +69,18 @@ Global
|
|||
{44465926-240D-473F-90B8-786BA4384406}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{44465926-240D-473F-90B8-786BA4384406}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{44465926-240D-473F-90B8-786BA4384406}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Release|x64.Build.0 = Release|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{73DA19D7-196D-4B16-B610-93250978A607}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
|
|
@ -57,6 +61,12 @@
|
|||
<Name>CatalogVbLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Settings\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,25 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CatalogLib
|
||||
{
|
||||
public class PicSettings
|
||||
{
|
||||
//TODO: Singleton
|
||||
private static PicSettings _instance = new PicSettings();
|
||||
|
||||
public static PicSettings Instance { get { return _instance; } }
|
||||
|
||||
private Dictionary<string, object> _settingsDict = new Dictionary<string, object>();
|
||||
|
||||
|
||||
public PicSettings()
|
||||
{
|
||||
SetDefaults();
|
||||
}
|
||||
|
||||
public string SerializeSettings()
|
||||
{
|
||||
return JsonConvert.SerializeObject(_settingsDict);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void Set(string key, object value)
|
||||
{
|
||||
if (_settingsDict.ContainsKey(key))
|
||||
|
|
@ -28,10 +39,27 @@ namespace CatalogLib
|
|||
}
|
||||
else
|
||||
{
|
||||
_settingsDict.Add(key,value);
|
||||
_settingsDict.Add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetString(string key, string value )
|
||||
{
|
||||
Set(key, value);
|
||||
}
|
||||
|
||||
public void SetInt(string key, int value)
|
||||
{
|
||||
Set(key,value);
|
||||
}
|
||||
|
||||
public void SetBool(string key, bool value)
|
||||
{
|
||||
Set(key, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool Exists(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key);
|
||||
|
|
@ -39,52 +67,50 @@ namespace CatalogLib
|
|||
|
||||
public int GetInt(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) ? (int) _settingsDict[key] : 0;
|
||||
return _settingsDict.ContainsKey(key) ? (int)_settingsDict[key] : 0;
|
||||
}
|
||||
|
||||
public string GetString(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) ? (string) _settingsDict[key] : string.Empty;
|
||||
return _settingsDict.ContainsKey(key) ? (string)_settingsDict[key] : string.Empty;
|
||||
}
|
||||
|
||||
public bool GetBool(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) && (bool) _settingsDict[key];
|
||||
return _settingsDict.ContainsKey(key) && (bool)_settingsDict[key];
|
||||
}
|
||||
|
||||
public void SetBool(string key, bool value)
|
||||
{
|
||||
if (_settingsDict.ContainsKey(key))
|
||||
{
|
||||
_settingsDict[key] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_settingsDict.Add(key, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public object GetObject(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) ? _settingsDict[key] : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void SetDefaults()
|
||||
{
|
||||
Set("dirSorgente",string.Empty);
|
||||
Set("dirDestinazione",string.Empty);
|
||||
Set("dirAggiornaSottodirectory", false);
|
||||
Set("dirCreaSottoCartelle",false);
|
||||
//Set("DirSorgente", string.Empty);
|
||||
//Set("DirDestinazione", string.Empty);
|
||||
//Set("DirAggiornaSottodirectory", false);
|
||||
//Set("DirCreaSottoCartelle", false);
|
||||
//Set();
|
||||
}
|
||||
|
||||
public bool Grassetto
|
||||
public bool DirAggiornaSottoDirectory
|
||||
{
|
||||
get { return this.GetBool("DirAggiornaSottoDirectory"); }
|
||||
set
|
||||
{
|
||||
this.SetBool("DirAggiornaSottoDirectory", value);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public bool Grassetto
|
||||
{
|
||||
get { return GetBool("Grassetto"); }
|
||||
set { SetBool("Grassetto", value);}
|
||||
set { SetBool("Grassetto", value); }
|
||||
}
|
||||
|
||||
public string IlFont //todo
|
||||
|
|
@ -123,33 +149,33 @@ namespace CatalogLib
|
|||
set { }
|
||||
}
|
||||
|
||||
public bool AggiungiScritteMiniature
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
public bool AggiungiScritteMiniature
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public string Suffisso
|
||||
{
|
||||
get { return string.Empty; }
|
||||
set { }
|
||||
}
|
||||
public string Suffisso
|
||||
{
|
||||
get { return string.Empty; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public string Codice
|
||||
{
|
||||
get { return null; }
|
||||
set {}
|
||||
}
|
||||
public string Codice
|
||||
{
|
||||
get { return null; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public int Trasparenza
|
||||
{
|
||||
get { return 0; }
|
||||
}
|
||||
public int Trasparenza
|
||||
{
|
||||
get { return 0; }
|
||||
}
|
||||
|
||||
public string Posizione
|
||||
{
|
||||
get { return string.Empty; }
|
||||
}
|
||||
public string Posizione
|
||||
{
|
||||
get { return string.Empty; }
|
||||
}
|
||||
|
||||
public bool UsaRotazioneAutomatica { get; set; }
|
||||
public DateTime DataPartenza { get; set; }
|
||||
|
|
@ -161,10 +187,14 @@ namespace CatalogLib
|
|||
public string TestoFirmaStart { get; set; }
|
||||
public string TestoFirmaStartV { get; set; }
|
||||
public bool UsaForzaJpg { get; set; }
|
||||
public string DirectorySorgente { get; set; }
|
||||
public string DirectoryDestinazione { get; set; }
|
||||
public string DirectorySorgente { get { return GetString("DirSorgente"); } set { SetString("DirSorgente", value); } }
|
||||
public string DirectoryDestinazione { get { return GetString("DirDestinazione"); } set { SetString("DirDestinazione", value);} }
|
||||
public float Margine { get; set; }
|
||||
public float MargVert { get; set; }
|
||||
public string Allineamento { get; set; }
|
||||
public bool GeneraleForzaJPG { get { return GetBool("GeneraleForzaJPG"); } set { SetBool("GeneraleForzaJPG", value);} }
|
||||
public bool GeneraleRotazioneAutomatica { get { return GetBool("GeneraleRotazioneAutomatica"); } set { SetBool("GeneraleRotazioneAutomatica", value); } }
|
||||
public bool GeneraleSovrascriviFile { get { return GetBool("GeneraleSovrascriviFile"); } set { SetBool("GeneraleSovrascriviFile", value); } }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
CatalogLib/packages.config
Normal file
4
CatalogLib/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
|
||||
</packages>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
BIN
WPFCatalog/Icons/document-open-folder.png
Normal file
BIN
WPFCatalog/Icons/document-open-folder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 852 B |
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
44
WPFCatalog/Properties/Resources.Designer.cs
generated
44
WPFCatalog/Properties/Resources.Designer.cs
generated
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
24
WPFCatalog/Properties/Settings.Designer.cs
generated
24
WPFCatalog/Properties/Settings.Designer.cs
generated
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue