Exemple #1
0
        public MainViewModel(IDatabaseCommunicator communicator,
                             IDbToolSettings settings,
                             ITypeCache typeCache)
        {
            _dispatcher   = Dispatcher.CurrentDispatcher;
            _communicator = communicator;
            _settings     = settings;
            _typeCache    = typeCache;

            ConnectCommand = new DelegateCommand(ToggleConnect);
            ExecuteCommand = new DelegateCommand(ExecuteStatement);

            Connection   = new ConnectionViewModel(_settings);
            QueryResult  = new QueryResultViewModel();
            _memoryMeter = new MemoryMeter(mem => MemoryUsage = mem.ToMemoryUsage());
            _memoryMeter.Start();
        }
        public MainViewModel(IDatabaseCommunicator communicator,
            IDbToolSettings settings,
            ITypeCache typeCache)
        {
            _dispatcher = Dispatcher.CurrentDispatcher;
            _communicator = communicator;
            _settings = settings;
            _typeCache = typeCache;

            ConnectCommand = new DelegateCommand(ToggleConnect);
            ExecuteCommand = new DelegateCommand(ExecuteStatement);

            Connection = new ConnectionViewModel(_settings);
            QueryResult = new QueryResultViewModel();
            _memoryMeter = new MemoryMeter(mem => MemoryUsage = mem.ToMemoryUsage());
            _memoryMeter.Start();
        }