コード例 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     List<IPlugin> plugins = new List<IPlugin>();
     foreach (TreeNode node in treeView1.Nodes)
     {
         IPlugin p = (IPlugin)node.Tag;
         if (p != null && node.Checked)
         {
             plugins.Add(p);
         }
     }
     if (plugins.Count > 0)
     {
         var form = new InstallPlugins();
         form.Owner = this.Owner;
         form.BeginInstall(plugins);
         form.ShowDialog();
     }
     if (treeView1.Nodes[0].Text == "MetaVideoEditor" && treeView1.Nodes[0].Checked)
     {
         var form = new InstallApp();
         form.Owner = this.Owner;
         form.BeginInstall();
         form.ShowDialog();
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
コード例 #2
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            List<string> rf = new List<string>();
            foreach (string s in Folders)
                rf.Add(s);
            if (Folders.Count == 0)
            {
                MessageBox.Show(Kernel.Instance.GetString("SelectFolderMess"), "MetaVideoEditor", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (Config.RootFolders.Count > 0 && !CompareFolders(Config.RootFolders, Folders))
            {
                DialogResult res = MessageBox.Show(Kernel.Instance.GetString("FolderModMess"), "MetaVideoEditor", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (res == DialogResult.No)
                    return;
                else
                    this.DialogResult = DialogResult.OK;
            }
            Config.EnableTraceLogging = LogBox.Checked;
            Config.RootFolders = Folders;
            Config.AddMissingData = AddDataCheckBox.Checked;
            Config.MinBackdropWidth = (int)MinPixelBox.SelectedItem;

            int maxbd = 0;
            if (!Int32.TryParse(NbBdBox.Text, out maxbd))
                maxbd = 1000;
            Config.MaxBdSaved = maxbd;
            /*
            Config.useProxy = boProxyUse.Checked;
            Config.ProxyAdress = strProxy.Text;
            Config.ProxyPort = strProxyPort.Text;
            Config.ProxyUser = strProxyUser.Text;
            Config.ProxyPass = strProxyPass.Text;*/
            Config.FilmExtension = strFilmExtension.Text;
            try { Config.Background = Backgrounds[BackgroundBox.SelectedIndex, 0]; }
            catch { Config.Background = Backgrounds[0, 0]; }
            Config.FullscreenMode = fullscreenBox.Checked;
            Config.UseTreeColor = UseColorBox.Checked;
            Config.RenameMovies = RenameMovieBox.Checked;
            Config.RenameSeries = RenameSeriesBox.Checked;
            Config.RenameSeasons = RenameSeasonBox.Checked;
            Config.RenameEpisodes = RenameEpisodeBox.Checked;
            Config.RemoveAccents = removeAccentsBox.Checked;
            Config.MoviePattern = MoviePatternBox.Text;
            Config.SeriesPattern = SeriesPatternBox.Text;
            Config.SeasonPattern = SeasonPatternBox.Text;
            Config.EpisodePattern = EpisodePatternBox.Text;
            foreach (var plugin in Kernel.Instance.Plugins.ToList())
                plugin.Save();
            foreach (IPlugin plugin in PluginsToRemove)
            {
                Kernel.Instance.DeletePlugin(plugin);
            }
            if (PluginsToAdd.Count > 0)
            {
                var form = new InstallPlugins();
                form.Owner = this.Owner;
                form.BeginInstall(PluginsToAdd);
                form.ShowDialog();
            }
            this.Close();
        }
コード例 #3
0
 private void wizardControl1_FinishButtonClick(object sender, EventArgs e)
 {
     Config.RootFolders = Folders;
     List<IPlugin> plugins = new List<IPlugin>();
     foreach (IPlugin plugin in PluginSourceCollection.Instance.AvailablePlugins)
     {
         if (checkedListBox1.CheckedItems.Contains(plugin.Name))
             plugins.Add(plugin);
         if (UseMBbox.Checked)
         {
             if (plugin.Name == "MediaBrowser Reader" || plugin.Name == "Folder.jpg Reader" || plugin.Name == "MediaBrowser Saver"
                 || plugin.Name == "Folder.jpg Saver")
                 plugins.Add(plugin);
         }
         if (useDVDIDbox.Checked)
         {
             if (plugin.Name == "DvD-ID" || plugin.Name == "Folder.jpg Reader" || plugin.Name == "Folder.jpg Saver")
             {
                 if (!plugins.Contains(plugin))
                     plugins.Add(plugin);
             }
         }
         if (useXBMCbox.Checked)
         {
             if (plugin.Name == "XBMC Reader" || plugin.Name == "XBMC Saver")
                 plugins.Add(plugin);
         }
     }
     if (plugins.Count > 0)
     {
         var form = new InstallPlugins();
         form.Owner = this.Owner;
         form.BeginInstall(plugins);
         form.ShowDialog();
     }
     this.Close();
 }