using System; using System.Collections.Generic; using System.Security; using System.Text; namespace DFEngine.Database { /// /// Represents a database server and holds information about the database host, port and access credentials. /// public class DatabaseServer { #region Fields #endregion Fields #region Properties /// /// The network host of the database server, eg 'localhost' or '127.0.0.1'. /// internal string Host { get; } /// /// The username to use when connecting to the database. /// internal string User { get; } /// /// The password to use in combination with the username when connecting to the database. /// internal string Password { get; } #endregion Properties #region Constructor /// /// Constructs a DatabaseServer object with given details. /// /// The network host of the database server, eg 'localhost' or '127.0.0.1'. /// The username to use when connecting to the database. /// The password to use in combination with the username when connecting to the database. internal DatabaseServer(string sHost, string sUser, string sPassword) { if (string.IsNullOrEmpty(sHost)) throw new ArgumentException("sHost is null or empty"); if (string.IsNullOrEmpty(sUser)) throw new ArgumentException("sUser is null or empty"); Host = sHost; User = sUser; Password = sPassword ?? ""; } #endregion Constructor #region Methods public override string ToString() { return User + "@" + Host; } #endregion Methods } }