Example #1
0
        private void EditConnectionAsync()
        {
            Views.Windows.ConnectionManagerWin connectionManagerWin = new Views.Windows.ConnectionManagerWin(SelectedNode as TreeViewModel);
            var res = connectionManagerWin.ShowDialog();

            XMLCore.ConnectionDeserialize();
            if (res != null && res == true)
            {
                var cmvm = connectionManagerWin.DataContext as ConnectionManagerVM;
                if (cmvm.EditModel != null)
                {
                    var con = XMLCore.Connections.FirstOrDefault(x => x.Connection.ConnectionName == cmvm.EditModel.ConnectionName);
                    con?.LoadDatabasesAsync();
                }
            }
        }
Example #2
0
        private async void EditConnectionAsync()
        {
            try
            {
                Views.Windows.ConnectionManagerWin connectionManagerWin = new Views.Windows.ConnectionManagerWin(SelectedNode as TreeViewModel);
                var res = connectionManagerWin.ShowDialog();

                XMLCore.ConnectionDeserialize();
                if (res != null && res == true)
                {
                    var cmvm = connectionManagerWin.DataContext as ConnectionManagerVM;
                    if (cmvm.ConnectionBuilder != null)
                    {
                        var con = XMLCore.Connections.FirstOrDefault(x => x.ConnectionBuilder.Id == cmvm.ConnectionBuilder.Id);
                        con?.LoadDatabasesAsync();
                    }
                }
            }
            catch (Exception ex)
            {
                await dialogCoordinator.ShowMessageAsync(this, $"Error!", $"Error message: {ex.Message}  \r\nStackTrace: {ex.StackTrace}");
            }
        }