public void AddDatabase(DbToolDatabase database) { if (Databases.Any(d => d.Name.EqualsIgnoreCase(database.Name))) { throw new UserException(ExceptionType.DatabaseAlreadyExists, database.Name); } Databases.Add(database); database.Parent = this; }
public void FromXml(XmlNode node) { Name = node.Attributes["name"].Value.ToString(); XmlNodeList list = node.SelectNodes("databases/database"); foreach (XmlNode dbnode in list) { QDatabase db = new QDatabase(Parent.EnvType, Name); db.Deserialize(dbnode); if (!Databases.Any(D => D.FullName == db.FullName)) { Databases.Add(db); } } }
public bool DatabaseExists(string databaseName) { return(Databases.Any(d => d.Name.Equals(databaseName, StringComparison.InvariantCultureIgnoreCase))); }