コード例 #1
0
        public static void TracePins(IBaseFilter pFilter, PinDirection direction)
        {
            IPin pPin  = null;
            int  nSkip = 0;

            // trace connected pins
            while ((pPin = GetPin(pFilter, direction, true, nSkip)) != null)
            {
                Trace.WriteLine(String.Format("{0} pin: type: {1}, connected: True",
                                              direction.ToString(), GetMediaTypeAsString(pPin)));
                nSkip++;
                Marshal.ReleaseComObject(pPin);
            }

            // trace unconnected pins
            nSkip = 0;
            while ((pPin = GetPin(pFilter, direction, false, nSkip)) != null)
            {
                Trace.WriteLine(String.Format("{0} pin: type: {1}, connected: False",
                                              direction.ToString(), GetMediaTypeAsString(pPin)));
                nSkip++;
                Marshal.ReleaseComObject(pPin);
            }
        }
コード例 #2
0
 public static string Value(this PinDirection pinDirection) => pinDirection.ToString().ToLower();