コード例 #1
0
        /// <summary>
        /// Method to invoke when the AddTab command is executed.
        /// </summary>
        private void OnAddTabExecute()
        {
            var vm = new CreateTabWindowViewModel();

            if (_uiVisualizerService.ShowDialog(vm) ?? false)
            {
                _tabService.AddTab(vm.CloseWhenUnloaded);
            }
        }
コード例 #2
0
        /// <summary>
        /// Method to invoke when the AddTab command is executed.
        /// </summary>
        private async Task OnAddTabExecuteAsync()
        {
            var vm = new CreateTabWindowViewModel();

            if (await _uiVisualizerService.ShowDialogAsync(vm) ?? false)
            {
                _tabService.AddTab(vm.CloseWhenUnloaded);
            }
        }
コード例 #3
0
ファイル: TabController.cs プロジェクト: Lavsiant/Tabber
        public async Task <IActionResult> CreateTab([FromBody] TabCreateViewModel tabCreateVM)
        {
            try
            {
                var tab = new Tab()
                {
                    Creator    = tabCreateVM.Creator,
                    Name       = tabCreateVM.Name,
                    Tempo      = tabCreateVM.Tempo,
                    GuitarType = (InstrumentType)tabCreateVM.Type,
                    Iterations = tabCreateVM.iterations
                };
                await _tabService.AddTab(tab);

                return(Ok(tab));
            }
            catch (Exception ex)
            {
                // return error message if there was an exception
                return(BadRequest(ex.Message));
            }
        }