예제 #1
0
 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;
 }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
 public bool DatabaseExists(string databaseName)
 {
     return(Databases.Any(d => d.Name.Equals(databaseName, StringComparison.InvariantCultureIgnoreCase)));
 }