コード例 #1
0
        /// <summary>
        /// Finds a native device by UDN.
        /// </summary>
        /// <param name="udn">The UDN for the device.</param>
        /// <param name="addressFamily">The address family to search in. (Vista or above only).</param>
        /// <returns>The device if one is found or null if not found.</returns>
        internal static IUPnPDevice FindNativeDeviceByUDN(
            string udn, AddressFamilyFlags addressFamily = AddressFamilyFlags.IPvBoth)
        {
            UPnPDeviceFinder lfFinder = new UPnPDeviceFinder();

            if (lfFinder is IUPnPAddressFamilyControl)
            {
                ((IUPnPAddressFamilyControl)lfFinder).SetAddressFamily((int)addressFamily);
            }

            return(lfFinder.FindByUDN(udn));
        }
コード例 #2
0
ファイル: ZonePlayer.cs プロジェクト: skavan/Sonority
        private static UPnPDevice FindByUDN(string uniqueDeviceName)
        {
            for (int i = 0; i < 3; ++i)
            {
                UPnPDevice device = _finder.FindByUDN(uniqueDeviceName);
                if (device != null)
                {
                    return(device);
                }
            }

            return(null);
        }
コード例 #3
0
ファイル: Discovery.cs プロジェクト: jogibear9988/ManagedUPnP
        /// <summary>
        /// Finds a native device by UDN.
        /// </summary>
        /// <param name="udn">The UDN for the device.</param>
        /// <param name="addressFamily">The address family to search in. (Vista or above only).</param>
        /// <returns>The device if one is found or null if not found.</returns>
        internal static IUPnPDevice FindNativeDeviceByUDN(
            string udn, AddressFamilyFlags addressFamily = AddressFamilyFlags.IPvBoth)
        {
            UPnPDeviceFinder lfFinder = new UPnPDeviceFinder();

            if (lfFinder is IUPnPAddressFamilyControl)
                ((IUPnPAddressFamilyControl)lfFinder).SetAddressFamily((int)addressFamily);

            return lfFinder.FindByUDN(udn);
        }