Creaccion de servicio de configuracion
parent
c88585690b
commit
3b05ca3a9f
|
|
@ -11,28 +11,28 @@ namespace OliviaAddInPro.Model
|
|||
{
|
||||
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()
|
||||
{
|
||||
if (conf == null)
|
||||
{
|
||||
conf = new OliviaConf();
|
||||
conf.leerConfig();
|
||||
}
|
||||
return conf;
|
||||
}
|
||||
[Browsable(false)]
|
||||
public string path_exe { get; set; }
|
||||
|
||||
void leerConfig()
|
||||
{
|
||||
//leer ini
|
||||
}
|
||||
[Browsable(false)]
|
||||
public string path_temp { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public string path_data { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
[Category("General")]
|
||||
[DisplayName("Red de carreteras")]
|
||||
[Description("Red de carreteras que se usara para la navegación")]
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@
|
|||
<Compile Include="Model\LimpiezaDef.cs" />
|
||||
<Compile Include="Model\OliviaConf.cs" />
|
||||
<Compile Include="Model\OliviaDef.cs" />
|
||||
<Compile Include="Services\ConfigServ.cs" />
|
||||
<Compile Include="Services\LimpiezaServ.cs" />
|
||||
<Compile Include="ViewModel\Configuracion\DockpaneConfigViewModel.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)
|
||||
{
|
||||
/*
|
||||
if (DataContext is PaneLimpiezaSub1ViewModel mod)
|
||||
{
|
||||
mod.ComboTtoSel(i);
|
||||
oldTtoSel = i;
|
||||
}
|
||||
*/
|
||||
|
||||
if (DataContext is PaneConfigViewModel mod)
|
||||
mod.OnGuardar();
|
||||
}
|
||||
|
||||
private void OnRefres(object sender, RoutedEventArgs e)
|
||||
{
|
||||
/*
|
||||
if (DataContext is PaneLimpiezaSub1ViewModel mod)
|
||||
{
|
||||
mod.ComboTtoSel(i);
|
||||
oldTtoSel = i;
|
||||
}
|
||||
*/
|
||||
if (DataContext is PaneConfigViewModel mod)
|
||||
mod.OnRefres();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,14 +5,15 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OliviaAddInPro.Model;
|
||||
using OliviaAddInPro.Services;
|
||||
namespace OliviaAddInPro
|
||||
{
|
||||
class PaneConfigViewModel : PanelViewModelBase
|
||||
{
|
||||
private OliviaConf conf;
|
||||
private OliviaConf conf=null;
|
||||
public PaneConfigViewModel()
|
||||
{
|
||||
conf = OliviaConf.Conf();
|
||||
OnRefres();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -24,7 +25,22 @@ namespace OliviaAddInPro
|
|||
public OliviaConf Configuracion
|
||||
{
|
||||
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