Compare commits
1 Commits
develop
...
Configurac
| Author | SHA1 | Date |
|---|---|---|
|
|
f973a2c5e2 |
|
|
@ -4,6 +4,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -13,9 +14,12 @@ using Xceed.Wpf.Toolkit.PropertyGrid.Editors;
|
|||
|
||||
namespace OliviaAddInPro.Model
|
||||
{
|
||||
//This defaults to AllowMultiple = false.
|
||||
|
||||
[Serializable]
|
||||
class OliviaConf
|
||||
{
|
||||
|
||||
public enum OpsRecoCont
|
||||
{
|
||||
[Description("Contenedor lleno")]
|
||||
|
|
@ -55,7 +59,11 @@ namespace OliviaAddInPro.Model
|
|||
TiempoOutSocket = 20;
|
||||
}
|
||||
|
||||
public void SimplificaConfig()
|
||||
{
|
||||
|
||||
//}
|
||||
}
|
||||
#region PropiedadesOcultas
|
||||
#region parametrosConexion
|
||||
/**
|
||||
|
|
@ -195,8 +203,9 @@ namespace OliviaAddInPro.Model
|
|||
[DisplayName("Eje via de red de carreteras")]
|
||||
[Description("Eje de via de red de carreteras que se usara para la navegación")]
|
||||
[Editor(typeof(PropertyGridFilePickerLine), typeof(PropertyGridFilePickerLine))]
|
||||
//[AtributoSimpleProperty]
|
||||
//[Editor(typeof(EditorFilePickerDefinition), typeof(EditorFilePickerDefinition))]
|
||||
public string Path_Eje_via { get; set; }
|
||||
public virtual string Path_Eje_via { get; set; }
|
||||
/*
|
||||
[Category("General")]
|
||||
[DisplayName("Red de carreteras")]
|
||||
|
|
@ -1318,4 +1327,23 @@ namespace OliviaAddInPro.Model
|
|||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[Serializable]
|
||||
class OliviaConfSimple: OliviaConf
|
||||
{
|
||||
[Browsable(false)]
|
||||
public override string Path_Eje_via
|
||||
{
|
||||
get {
|
||||
return base.Path_Eje_via;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Path_Eje_via = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
|||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.Win32;
|
||||
using System.Windows;
|
||||
|
||||
namespace OliviaAddInPro.Services
|
||||
{
|
||||
|
|
@ -26,13 +27,23 @@ namespace OliviaAddInPro.Services
|
|||
}
|
||||
}
|
||||
|
||||
public OliviaConf Leer()
|
||||
public OliviaConf Leer(bool simplif=false)
|
||||
{
|
||||
var aa= System.Reflection.Assembly.GetEntryAssembly().Location;
|
||||
var executingAssembly = System.Reflection.Assembly.GetExecutingAssembly(); //MyLibrary.dll
|
||||
var callingAssembly = System.Reflection.Assembly.GetCallingAssembly(); //MyLibrary.dll
|
||||
var entryAssembly = System.Reflection.Assembly.GetEntryAssembly(); //WpfApp.exe or MyLibrary.dll
|
||||
|
||||
|
||||
OliviaConf res = null;
|
||||
try
|
||||
{
|
||||
if(!simplif)
|
||||
res = JsonConvert.DeserializeObject<OliviaConf>(File.ReadAllText(GetPathConfig()));
|
||||
}catch(Exception e)
|
||||
else
|
||||
res = JsonConvert.DeserializeObject<OliviaConfSimple>(File.ReadAllText(GetPathConfig()));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
var ee = e;
|
||||
res = null;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,14 @@ namespace OliviaAddInPro
|
|||
|
||||
public void OnRefres()
|
||||
{
|
||||
Configuracion = ConfigServ.Serv.Leer();
|
||||
ReferesConfig(true);
|
||||
|
||||
}
|
||||
|
||||
private void ReferesConfig(bool simplificado)
|
||||
{
|
||||
Configuracion = ConfigServ.Serv.Leer(simplificado);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue