コード例 #1
0
 public static IPin GetPin(this IBaseFilter filter, Guid category, int index)
 {
     return(filter.EnumeratePinsUntil((pin, i) =>
     {
         bool found = false;
         var pinCategory = pin.GetPinCategory();
         if (pinCategory == category)
         {
             found = (i == index);
         }
         return found;
     }));
 }
コード例 #2
0
        /// <summary>
        /// Gets a specific pin of a specific filter
        /// </summary>
        /// <param name="filter">Filter to retrieve the pin for (defines which object should make this method available)</param>
        /// <param name="dir">Direction</param>
        /// <param name="num">Number</param>
        /// <returns>IPin object or null</returns>
        public static IPin GetPin(this IBaseFilter filter, PinDirection dir, int index)
        {
            return(filter.EnumeratePinsUntil((pin, i) =>
            {
                bool found = false;

                // Query the direction
                PinDirection pinDir;
                pin.QueryDirection(out pinDir);

                // Is the pin direction correct?
                if (pinDir == dir)
                {
                    found = (i == index);
                }

                return found;
            }));
        }