Creaccion de servicio de configuracion
parent
c88585690b
commit
3b05ca3a9f
|
|
@ -11,28 +11,28 @@ namespace OliviaAddInPro.Model
|
||||||
{
|
{
|
||||||
private static OliviaConf conf=null;
|
private static OliviaConf conf=null;
|
||||||
|
|
||||||
private OliviaConf()
|
public OliviaConf()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#region PropiedadesOcultas
|
||||||
|
|
||||||
|
#region Paths
|
||||||
|
[Browsable(false)]
|
||||||
|
public string path_work { get; set; }
|
||||||
|
|
||||||
static public OliviaConf Conf()
|
[Browsable(false)]
|
||||||
{
|
public string path_exe { get; set; }
|
||||||
if (conf == null)
|
|
||||||
{
|
|
||||||
conf = new OliviaConf();
|
|
||||||
conf.leerConfig();
|
|
||||||
}
|
|
||||||
return conf;
|
|
||||||
}
|
|
||||||
|
|
||||||
void leerConfig()
|
[Browsable(false)]
|
||||||
{
|
public string path_temp { get; set; }
|
||||||
//leer ini
|
|
||||||
}
|
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public string path_data { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
[Category("General")]
|
[Category("General")]
|
||||||
[DisplayName("Red de carreteras")]
|
[DisplayName("Red de carreteras")]
|
||||||
[Description("Red de carreteras que se usara para la navegación")]
|
[Description("Red de carreteras que se usara para la navegación")]
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@
|
||||||
<Compile Include="Model\LimpiezaDef.cs" />
|
<Compile Include="Model\LimpiezaDef.cs" />
|
||||||
<Compile Include="Model\OliviaConf.cs" />
|
<Compile Include="Model\OliviaConf.cs" />
|
||||||
<Compile Include="Model\OliviaDef.cs" />
|
<Compile Include="Model\OliviaDef.cs" />
|
||||||
|
<Compile Include="Services\ConfigServ.cs" />
|
||||||
<Compile Include="Services\LimpiezaServ.cs" />
|
<Compile Include="Services\LimpiezaServ.cs" />
|
||||||
<Compile Include="ViewModel\Configuracion\DockpaneConfigViewModel.cs" />
|
<Compile Include="ViewModel\Configuracion\DockpaneConfigViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Configuracion\PaneConfigViewModel.cs" />
|
<Compile Include="ViewModel\Configuracion\PaneConfigViewModel.cs" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
using OliviaAddInPro.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OliviaAddInPro.Services
|
||||||
|
{
|
||||||
|
class ConfigServ
|
||||||
|
{
|
||||||
|
private static ConfigServ configServ=null;
|
||||||
|
|
||||||
|
public static ConfigServ Serv
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
if (configServ == null)
|
||||||
|
configServ = new ConfigServ();
|
||||||
|
return configServ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public OliviaConf Leer()
|
||||||
|
{
|
||||||
|
return new OliviaConf();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Guardar(OliviaConf conf)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,23 +28,15 @@ namespace OliviaAddInPro
|
||||||
}
|
}
|
||||||
private void OnGuardar(object sender, RoutedEventArgs e)
|
private void OnGuardar(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if (DataContext is PaneLimpiezaSub1ViewModel mod)
|
if (DataContext is PaneConfigViewModel mod)
|
||||||
{
|
mod.OnGuardar();
|
||||||
mod.ComboTtoSel(i);
|
|
||||||
oldTtoSel = i;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnRefres(object sender, RoutedEventArgs e)
|
private void OnRefres(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
/*
|
if (DataContext is PaneConfigViewModel mod)
|
||||||
if (DataContext is PaneLimpiezaSub1ViewModel mod)
|
mod.OnRefres();
|
||||||
{
|
|
||||||
mod.ComboTtoSel(i);
|
|
||||||
oldTtoSel = i;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,15 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using OliviaAddInPro.Model;
|
using OliviaAddInPro.Model;
|
||||||
|
using OliviaAddInPro.Services;
|
||||||
namespace OliviaAddInPro
|
namespace OliviaAddInPro
|
||||||
{
|
{
|
||||||
class PaneConfigViewModel : PanelViewModelBase
|
class PaneConfigViewModel : PanelViewModelBase
|
||||||
{
|
{
|
||||||
private OliviaConf conf;
|
private OliviaConf conf=null;
|
||||||
public PaneConfigViewModel()
|
public PaneConfigViewModel()
|
||||||
{
|
{
|
||||||
conf = OliviaConf.Conf();
|
OnRefres();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -24,7 +25,22 @@ namespace OliviaAddInPro
|
||||||
public OliviaConf Configuracion
|
public OliviaConf Configuracion
|
||||||
{
|
{
|
||||||
get { return conf; }
|
get { return conf; }
|
||||||
set { base.SetProperty(ref conf, value, () => conf); }
|
set
|
||||||
|
{
|
||||||
|
base.SetProperty(ref conf, value, () => conf);
|
||||||
|
ConfiguracioProperty.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnGuardar()
|
||||||
|
{
|
||||||
|
ConfigServ.Serv.Guardar(Configuracion);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnRefres()
|
||||||
|
{
|
||||||
|
Configuracion = ConfigServ.Serv.Leer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue