コード例 #1
0
        // after form loaded
        private void FormMain_Shown(object sender, EventArgs e)
        {
            MyFormField.HighlightFormFieldsOnFocus(this);

            loadVideos.AddAccessToSubForms(subFormListView, subFormGallery, subFormVideoForm, subFormFilterForm, subFormProgressMain);


            Application.DoEvents(); // meh



            // ensure required app dirs exist
            MyFile.EnsureDirectoryExists(@"cache");
            MyFile.EnsureDirectoryExists(@"cache\gallery");
            MyFile.EnsureDirectoryExists(@"config");
            MyFile.EnsureDirectoryExists(@"data");
            MyFile.EnsureDirectoryExists(@"filters");
            MyFile.EnsureDirectoryExists(@"libs");
            MyFile.EnsureDirectoryExists(@"libs\ffmpeg\bin");
            MyFile.EnsureDirectoryExists(@"logs");
            MyFile.EnsureDirectoryExists(@"stats");
            MyFile.EnsureDirectoryExists(@"sync");



            if (Config.settings.sources.Count == 0)
            {
                MessageBox.Show("No Video Sources found. Add some and Scan..");
                ShowFormSources();
                return;
            }

            if (ListVideoInfo.Load())
            {
                loadVideos.FilterListView();
            }
            else
            {
                loadVideos.LoadFromDisk();
            }
        }
コード例 #2
0
        private void buttonScan_Click(object sender, EventArgs e)
        {
            if (currentSource == null)
            {
                return;
            }

            buttonSourceDirectory.Enabled = false;
            buttonSaveSource.Enabled      = false;
            buttonScanSource.Enabled      = false;
            buttonRemoveSource.Enabled    = false;
            buttonAddSource.Enabled       = false;

            // meh, but works
            FormMain   formMain   = (FormMain)this.Owner;
            LoadVideos loadVideos = formMain.GetLoadVideos();

            loadVideos.loadVideos_Completed += new EventHandler(LoadVideos_Completed);
            loadVideos.AddAccessToSubFormProgress(subFormProgressOptions);
            loadVideos.LoadFromDisk(currentSource);
        }