Commit inicial
This commit is contained in:
101
ServerExplorer/Config.cs
Normal file
101
ServerExplorer/Config.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ServerExplorer
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
public String ConString = "";
|
||||
public String pathRaiz = ".";
|
||||
public String PathRaiz
|
||||
{
|
||||
get { return pathRaiz; }
|
||||
set { pathRaiz = value; }
|
||||
}
|
||||
public String pathDAL=".";
|
||||
public String PathDAL
|
||||
{
|
||||
get
|
||||
{
|
||||
if (pathDAL == ".")
|
||||
{
|
||||
return pathRaiz;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pathDAL;
|
||||
}
|
||||
}
|
||||
set { pathDAL = value; }
|
||||
}
|
||||
public String pathDTO = ".";
|
||||
public String PathDTO
|
||||
{
|
||||
get {
|
||||
if (pathDTO == ".")
|
||||
{
|
||||
return pathRaiz;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pathDTO;
|
||||
}
|
||||
}
|
||||
set { pathDTO = value; }
|
||||
}
|
||||
public String pathExtra = ".";
|
||||
public String PathExtra
|
||||
{
|
||||
get {
|
||||
if (pathExtra == ".")
|
||||
{
|
||||
return pathRaiz;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pathExtra;
|
||||
}
|
||||
}
|
||||
set { pathExtra = value; }
|
||||
}
|
||||
public String NamespaceDAL = "DAL";
|
||||
public String NamespaceDTO = "DTO";
|
||||
public List<TablaInfo> Tablas = new List<TablaInfo>();
|
||||
|
||||
public Config() { }
|
||||
|
||||
public void Guardar(String fichero)
|
||||
{
|
||||
XmlSerializer seriador = new XmlSerializer(typeof(Config));
|
||||
StreamWriter escritor = new StreamWriter(fichero);
|
||||
seriador.Serialize(escritor, this);
|
||||
escritor.Close();
|
||||
}
|
||||
|
||||
public static Config Cargar(String fichero)
|
||||
{
|
||||
XmlSerializer seriador = new XmlSerializer(typeof(Config));
|
||||
StreamReader lector = new StreamReader(fichero);
|
||||
Config config = (Config)seriador.Deserialize(lector);
|
||||
lector.Close();
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class TablaInfo
|
||||
{
|
||||
public String Esquema="";
|
||||
public String Nombre="";
|
||||
|
||||
public TablaInfo() { }
|
||||
public TablaInfo(String esquema, String nombre)
|
||||
{
|
||||
Esquema = esquema;
|
||||
Nombre = nombre;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user