Files
2016-07-27 00:32:34 -04:00

109 lines
3.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Collections;
namespace PlutoServer.MSL.Connectors
{
/// <summary>
/// Serializable Xml Object used to store all Configuration data - place any new class objects in here
/// </summary>
[XmlRoot("configuration", Namespace = "PlutoServerMSL", IsNullable = false)]
public class DBCacheDataStore
{
// Member Tags <>
public SQLServerCredentialsW SQLServerCredentials = null;
public AdvantageCredentialsW AdvantageCredentials = null;
public class SQLServerCredentialsW
{
private ArrayList m_ArrayList;
public SQLServerCredentialsW()
{
m_ArrayList = new ArrayList();
}
[XmlElement("Credential")]
public Credential[] Credentials
{
get
{
Credential[] credentials = new Credential[m_ArrayList.Count];
m_ArrayList.CopyTo(credentials);
return credentials;
}
set
{
if (value == null) return;
Credential[] credentials = (Credential[])value;
m_ArrayList.Clear();
foreach (Credential credential in credentials)
m_ArrayList.Add(credential);
}
}
internal void AddCredential(Credential credential)
{
m_ArrayList.Add(credential);
}
}
public class AdvantageCredentialsW
{
private ArrayList m_ArrayList;
public AdvantageCredentialsW()
{
m_ArrayList = new ArrayList();
}
[XmlElement("Credential")]
public Credential[] Credentials
{
get
{
Credential[] credentials = new Credential[m_ArrayList.Count];
m_ArrayList.CopyTo(credentials);
return credentials;
}
set
{
if (value == null) return;
Credential[] credentials = (Credential[])value;
m_ArrayList.Clear();
foreach (Credential credential in credentials)
m_ArrayList.Add(credential);
}
}
internal void AddCredential(Credential credential)
{
m_ArrayList.Add(credential);
}
}
public class Credential
{
public string SqlServer;
public string SqlInstance;
public string SqlUser;
public string SqlPassword;
public string AdvDataSource;
public bool AdvIsRemote;
}
/// <summary>
/// DBCacheDataStore configuration - Constructor
/// </summary>
public DBCacheDataStore()
{
SQLServerCredentials = new SQLServerCredentialsW();
AdvantageCredentials = new AdvantageCredentialsW();
}
}
}