Exemplo n.º 1
0
        /// <summary>
        /// Sets the position of a specified wireless profile in preference order.
        /// </summary>
        /// <param name="interfaceId">Interface ID</param>
        /// <param name="profileName">Profile name</param>
        /// <param name="position">Position (starting from 0)</param>
        /// <returns>True if successfully set.</returns>
        public static bool SetProfilePosition(Guid interfaceId, string profileName, int position)
        {
            if (interfaceId == Guid.Empty)
            {
                throw new ArgumentException(nameof(interfaceId));
            }

            if (string.IsNullOrWhiteSpace(profileName))
            {
                throw new ArgumentNullException(nameof(profileName));
            }

            if (position < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(position));
            }

            using (var client = new Base.WlanClient())
            {
                return(Base.SetProfilePosition(client.Handle, interfaceId, profileName, (uint)position));
            }
        }