コード例 #1
0
        /// <summary>
        /// Scans the interfaces for the filter and it's pins and displays them in a Dialog
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void _interfacesButton_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            PropertiesDialog pd = null;

            // are we in modal or non-modal mode
            if (this.Parent is PropertiesDialog)
            {
                pd = new PropertiesDialog((this.Parent as PropertiesDialog).Text + " Interfaces");
            }
            else
            {
                pd = new PropertiesDialog((this.Parent.Parent as DSFilterNodeUI).CaptionText + " Interfaces");
            }

            pd.TextBox.AppendText("Filter Interfaces:\r\n");

            // create the array of assemblie we want to scan interfaces against
            Assembly[] assemblies = new Assembly[2] {
                typeof(IBaseFilter).Assembly, typeof(IMFGetService).Assembly
            };

            // scan the filter's interfaces
            List <InterfacePair> pairs = InterfaceScanner.Scan(assemblies, _filter);

            foreach (InterfacePair p in pairs)
            {
                pd.TextBox.AppendText(p.InterfaceGuid.ToString() + "\t" + p.InterfaceName + "\r\n");
            }

            // scan the pin interfaces
            foreach (Control c in this.TabControl.Controls)
            {
                if (c.Tag is IPin)
                {
                    pd.TextBox.AppendText("\r\n" + c.Text + " Pin Interfaces:\r\n");

                    List <InterfacePair> pinpairs = InterfaceScanner.Scan(assemblies, c.Tag);
                    foreach (InterfacePair p in pinpairs)
                    {
                        pd.TextBox.AppendText(p.InterfaceGuid.ToString() + "\t" + p.InterfaceName + "\r\n");
                    }
                }
            }
            Cursor = Cursors.Default;
            pd.ShowDialog(this.TopLevelControl);
        }
コード例 #2
0
ファイル: DSFilterNodeUI.cs プロジェクト: manuag/DSGraphEdit
 private void _expandPropertiesButton_Click(object sender, EventArgs e)
 {
     if ((this.Parent as DSDaggerUIGraph).ModalProperties && ((_dsfilternode._filter as IDMOWrapperFilter) == null))
     {
         try
         {
             PropertiesDialog pd = new PropertiesDialog(CaptionText, _dsfilternode._filter);
             SyncPinPropertyPages(pd.PropertyPagePanel);
             pd.ShowDialog(this.TopLevelControl);
             pd.Dispose();
             _dsfilternode.SyncPins();
             pd = null;
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Error creating Proprty Page");
         }
     }
 }
コード例 #3
0
ファイル: DSFilterNodeUI.cs プロジェクト: manuag/DSGraphEdit
        /// <summary>
        /// User has clicked on a pin properties menu item
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void tmi_Click(object sender, EventArgs e)
        {
            // if this pin implements ISpecifyPropertyPages, show that instead
            PropertiesDialog pd;
            IPin             pin = null;
            string           pinname;

            // get the DaggerPin
            DSOutputPin opin = (sender as ToolStripMenuItem).Tag as DSOutputPin;

            if (opin != null)
            {
                // it's an output pin
                pin     = opin._pin;
                pinname = opin.Name;
            }
            else
            {
                // it's an input pin
                pin     = ((sender as ToolStripMenuItem).Tag as DSInputPin)._pin;
                pinname = ((sender as ToolStripMenuItem).Tag as DSInputPin).Name;
            }

            ISpecifyPropertyPages proppage = pin as ISpecifyPropertyPages;
            bool displayed = false;

            if (proppage != null)
            {
                // display the pin's property pages
                displayed = DirectShowLib.Utils.FilterGraphTools.ShowPinFilterPropertyPage(pin, this.TopLevelControl.Handle, pinname);
            }

            // if ShowPinFilterPropertyPage failed, or there's no ISpecifyPropertyPages, show the default pin info
            if (!displayed)
            {
                pd = new PropertiesDialog(pinname, pin);
                pd.ShowDialog();
                pd.Dispose();
                pd = null;
            }
        }