private void chromaEnabler_CheckedChanged(object sender, EventArgs e)
        {
            if (dataGridViewStreams.SelectedRows != null && dataGridViewStreams.SelectedRows.Count > 0)
            {
                IMPlugins pPlugins = dataGridViewStreams.SelectedRows[0].Tag as IMPlugins;
                int       nCount;
                long      nCBCookie;
                object    pPlugin = null;
                bool      isCK    = false;
                pPlugins.PluginsGetCount(out nCount);
                for (int i = 0; i < nCount; i++)
                {
                    pPlugins.PluginsGetByIndex(i, out pPlugin, out nCBCookie);

                    if (pPlugin.GetType() == typeof(MChromaKeyClass))
                    {
                        isCK = true;
                        break;
                    }
                }


                if (chromaEnabler.Checked == true && isCK == false)
                {
                    pPlugins.PluginsAdd(new MCHROMAKEYLib.MChromaKey(), 0);
                }
                else if (chromaEnabler.Checked == false && isCK == true)
                {
                    pPlugins.PluginsRemove(pPlugin);
                }
                CKProps.Enabled = chromaEnabler.Checked;
            }
        }
 private MCHROMAKEYLib.MChromaKey GetChromakeyFilter(object source)
 {
     MCHROMAKEYLib.MChromaKey pChromaKey = null;
     try
     {
         int       nCount   = 0;
         IMPlugins pPlugins = (IMPlugins)source;
         pPlugins.PluginsGetCount(out nCount);
         for (int i = 0; i < nCount; i++)
         {
             object pPlugin;
             long   nCBCookie;
             pPlugins.PluginsGetByIndex(i, out pPlugin, out nCBCookie);
             try
             {
                 pChromaKey = (MCHROMAKEYLib.MChromaKey)pPlugin;
                 break;
             }
             catch { }
         }
     }
     catch { }
     return(pChromaKey);
 }