コード例 #1
0
        public ConnectionManagerVM(IConnectionManagerModel iConnectionManagerModel, Dictionary <string, IConnectivityTester> testers)
        {
            model                       = iConnectionManagerModel;
            testerDict                  = testers;
            LoadConnectionsCommand      = new DelegateCommand(LoadConnections);
            CreateConnectionCommand     = new DelegateCommand(CreateConnection);
            SaveConnectionsCommand      = new DelegateCommand(SaveConnections);
            TestConnectionCommand       = new DelegateCommand <DatabaseConnectionInfo>(TestConnection);
            TestAllConnectionsCommand   = new DelegateCommand(TestAllConnections);
            RemoveConnectionsCommand    = new DelegateCommand <IList>(RemoveConnections);
            RemoveAllConnectionsCommand = new DelegateCommand(RemoveAllConnections);
            DuplicateConnectionsCommand = new DelegateCommand(DuplicateConnection);

            //Selection Commands
            ConnectionSelectedCommand = new DelegateCommand <DatabaseConnectionInfo>(x => SelectedConnection = x);
            // ConnectionsSelectedCommand = new DelegateCommand<IList>(x => SelectedConnections = x.ToObservableCollection<DatabaseConnectionInfo>());
            ConnectionsSelectedCommand = new DelegateCommand <IList>(ConnectionsSelected);

            //new windows and Dialogs
            ShowQueryWindowCommand         = new DelegateCommand <DatabaseConnectionInfo>(x => OnShowQueryWindow.Raise(this, new DatabaseConnectionInfoEventArgs(x)));
            ShowSchemaBrowserWindowCommand = new DelegateCommand <DatabaseConnectionInfo>(x => OnShowSchemaBrowserWindow.Raise(this, new DatabaseConnectionInfoEventArgs(x)));

            //initialize collection
            SelectedConnections = new ObservableCollection <DatabaseConnectionInfo>();
        }
コード例 #2
0
        public ConnectionManagerVM(IConnectionManagerModel iConnectionManagerModel, Dictionary<string, IConnectivityTester> testers)
        {
            model = iConnectionManagerModel;
            testerDict = testers;
            LoadConnectionsCommand = new DelegateCommand(LoadConnections);
            CreateConnectionCommand = new DelegateCommand(CreateConnection);
            SaveConnectionsCommand = new DelegateCommand(SaveConnections);
            TestConnectionCommand = new DelegateCommand<DbConnectionInfo>(TestConnection);
            TestAllConnectionsCommand = new DelegateCommand(TestAllConnections);
            RemoveConnectionsCommand = new DelegateCommand<IList>(RemoveConnections);
            RemoveAllConnectionsCommand = new DelegateCommand(RemoveAllConnections);
            DuplicateConnectionsCommand = new DelegateCommand(DuplicateConnection);

            //Selection Commands
            ConnectionSelectedCommand = new DelegateCommand<DbConnectionInfo>(x => SelectedConnection = x);
            // ConnectionsSelectedCommand = new DelegateCommand<IList>(x => SelectedConnections = x.ToObservableCollection<DbConnectionInfo>());
            ConnectionsSelectedCommand = new DelegateCommand<IList>(ConnectionsSelected);

            //new windows and Dialogs
            ShowQueryWindowCommand = new DelegateCommand<DbConnectionInfo>(x => OnShowQueryWindow.Raise(this, new DatabaseConnectionInfoEventArgs(x)));
            ShowSchemaBrowserWindowCommand = new DelegateCommand<DbConnectionInfo>(x => OnShowSchemaBrowserWindow.Raise(this, new DatabaseConnectionInfoEventArgs(x)));

            //initialize collection
            SelectedConnections = new ObservableCollection<DbConnectionInfo>();

        }