Esempio n. 1
0
        private void AddTgFolder()
        {
            string folderLocation = FileBrowser.BrowseForFolder();

            if (string.IsNullOrWhiteSpace(folderLocation))
            {
                return;
            }

            ObservableCollection <SingleMouseViewModel> currentList = new ObservableCollection <SingleMouseViewModel>(TgItemsSource);

            string[] files = Directory.GetFiles(folderLocation);

            foreach (string file in files)
            {
                string extension = Path.GetExtension(file);

                if (CheckIfExtensionIsVideo(extension))
                {
                    ISingleMouse newFile = ModelResolver.Resolve <ISingleMouse>();
                    newFile.AddFile(GetSingleFile(file));
                    newFile.Name = Path.GetFileNameWithoutExtension(file);
                    currentList.Add(new SingleMouseViewModel(newFile));
                }
            }

            TgItemsSource = currentList;
        }
Esempio n. 2
0
        private void AddTgFile()
        {
            string fileLocation = FileBrowser.BroseForVideoFiles();

            if (string.IsNullOrWhiteSpace(fileLocation))
            {
                return;
            }


            ISingleMouse newFile = ModelResolver.Resolve <ISingleMouse>();

            newFile.AddFile(GetSingleFile(fileLocation));
            newFile.Name = Path.GetFileNameWithoutExtension(fileLocation);

            SingleMouseViewModel viewModel = new SingleMouseViewModel(newFile);

            ObservableCollection <SingleMouseViewModel> currentList = new ObservableCollection <SingleMouseViewModel>(TgItemsSource);

            currentList.Add(viewModel);
            TgItemsSource = currentList;
        }