예제 #1
0
        private void Connect(ServerViewModel server)
        {
            var frm = new LoginWindow(server.Name);

            frm.Owner = this;
            frm.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            if (frm.ShowDialog() == true)
            {
                server.Server = frm.Server;
                foreach (Database db in server.Server.Databases)
                {
                    try {
                        if (db.Tables.Contains("tblMaterial") && db.Tables.Contains("tblBiota"))
                        {
                            var vm = new DatabaseViewModel(db);
                            server.Children.Add(vm);
                        }
                    } catch (Exception) {
                    }
                }
                server.IsExpanded = true;
            }
        }
예제 #2
0
        private void Connect(ServerViewModel server)
        {
            var frm = new LoginWindow(server.Name);
            frm.Owner = this;
            frm.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            if (frm.ShowDialog() == true) {
                server.Server = frm.Server;
                foreach (Database db in server.Server.Databases) {
                    try {
                        if (db.Tables.Contains("tblMaterial") && db.Tables.Contains("tblBiota")) {
                            var vm = new DatabaseViewModel(db);
                            server.Children.Add(vm);
                        }
                    } catch (Exception) {

                    }
                }
                server.IsExpanded = true;
            }
        }