public DatabaseExplorerServerViewModel(string name, MongoServer serv) : base(name, ItemType.Server) { _serv = serv; GetDatabases(); AddDBCommand = new OpenTabCommand(() => new AddDatabaseViewModel(_serv)); ServerOverviewCommand = new OpenTabCommand(() => new ServerOverViewViewModel(_serv)); MessengerInstance.Register(this, (NotificationMessage <DatabaseExplorerDatabaseViewModel> x) => DBAddedMessage(x)); }
public async Task Create([FromBody] OpenTabDto openTabDto) { var openTabCommand = new OpenTabCommand { Id = Guid.NewGuid(), Waiter = openTabDto.Waiter, TableNumber = openTabDto.TableNumber }; await _commandSender.Send(openTabCommand); }
public MainViewModel() { Content = new ObservableCollection <object>(); Content.CollectionChanged += Content_CollectionChanged; // Content.Add( new ConnectionsViewModel()); SimpleIoc.Default.Register <DatabaseExplorerViewModel>(); SettingsCommand = new OpenTabCommand(() => new SettingsViewModel()); Explorer = SimpleIoc.Default.GetInstance <DatabaseExplorerViewModel>(); AssignCommands <NoWeakRelayCommand>(); CloseTabCommand = new RelayCommand <object>(CloseTab); }
public DatabaseExplorerDatabaseViewModel(MongoDatabase db) : base(db.Name, ItemType.Database) { _db = db; GetCollections(); MessengerInstance.Register(this, (NotificationMessage <DatabaseExplorerCollectionViewModel> x) => AddedColl(x)); AssignCommands <NoWeakRelayCommand>(); JoinTablesFromMSSQLCommand = new OpenTabCommand(() => new JoinSQLTablesViewModel(db)); }
public DatabaseExplorerCollectionViewModel(MongoCollection <BsonDocument> coll) : base(coll.Name, ItemType.Collection) { _coll = coll; FindCommand = new OpenTabCommand(() => new FindViewModel(_coll)); StatsCommand = new OpenTabCommand(() => new CollectionStatsViewModel(_coll)); AddDocumentCommand = new OpenTabCommand(() => new AddDocumentViewModel(_coll)); AggregateCommand = new OpenTabCommand(() => new AggregateViewModel(_coll)); AddIndexCommand = new OpenTabCommand(() => new AddIndexViewModel(_coll)); MakeCappedCommand = new OpenTabCommand(() => new MakeCollectionCappedViewModel(_coll)); RenameFieldsCommand = new OpenTabCommand(() => new RenameFieldsViewModel(_coll)); MakeTTLCommand = new OpenTabCommand(() => new MakeTTLViewModel(_coll)); CompactCommand = new NoWeakRelayCommand(() => _coll.Database.RunCommand(new CommandDocument("compact", _coll.Name))); DropCommand = new RelayCommand(() => { MessengerInstance.Send(new NotificationMessage <DatabaseExplorerCollectionViewModel>(this, this, "dropped")); _coll.Drop(); }); }
private bool CheckCommand(OpenTabCommand c) { return(c.Id != Guid.Empty && c.Waiter == _openTabDto.Waiter && c.TableNumber == _openTabDto.TableNumber); }