Example #1
0
        private async Task openFile(string path)
        {
            var mdiChild = _mdiContainer.MdiChildren.Values.FirstOrDefault(c => c.ViewModel.Path == path);

            if (mdiChild == null)
            {
                TsiFileViewModel vm = await TsiFileViewModel.LoadAsync(path);

                if (vm != null)
                {
                    _tsiFileViewModels.Add(vm);
                    openTab(vm);
                    _mru.Add(path);
                }
                else
                {
                    MessageBoxHelper.ShowError(
                        String.Format(
                            "Cannot open file: {0}.\n" +
                            "\n" +
                            "Please confirm the file opens correctly in Traktor, and then upload the TSI to https://github.com/pestrela/cmdr/issues",
                            path
                            ));
                }
            }
            else
            {
                _mdiContainer.SelectMdiChild(mdiChild.Id);
            }
        }
Example #2
0
        private async Task openFile(string path)
        {
            var mdiChild = _mdiContainer.MdiChildren.Values.FirstOrDefault(c => c.ViewModel.Path == path);

            if (mdiChild == null)
            {
                TsiFileViewModel vm = await TsiFileViewModel.LoadAsync(path);

                if (vm != null)
                {
                    _tsiFileViewModels.Add(vm);
                    openTab(vm);
                    _mru.Add(path);
                }
                else
                {
                    MessageBoxHelper.ShowError("Cannot open file.\nPlease upload the TSI in https://github.com/pestrela/cmdr/issues");
                }
            }
            else
            {
                _mdiContainer.SelectMdiChild(mdiChild.Id);
            }
        }