/// <summary>
        /// This is the click handler for the 'FindConnectionProfilesButton' button.  You would replace this with your own handler
        /// if you have a button or buttons on this page.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FindConnectionProfilesButton_Click(object sender, RoutedEventArgs e)
        {
            Guid serviceProviderGuid;

            // Add values to the filter. If we don't care about a particular field, we don't set it.
            ConnectionProfileFilter filter = new ConnectionProfileFilter();
            switch (((ComboBoxItem)IsConnectedComboBox.SelectedItem).Content.ToString())
            {
                case "Yes":
                    filter.IsConnected = true;
                    break;
                case "No":
                    filter.IsConnected = false;
                    break;
            }

            switch (((ComboBoxItem)IsWlanProfileComboBox.SelectedItem).Content.ToString())
            {
                case "Yes":
                    filter.IsWlanConnectionProfile = true;
                    break;
                case "No":
                    filter.IsWlanConnectionProfile = false;
                    break;
            }

            switch (((ComboBoxItem)IsWwanProfileComboBox.SelectedItem).Content.ToString())
            {
                case "Yes":
                    filter.IsWwanConnectionProfile = true;
                    break;
                case "No":
                    filter.IsWwanConnectionProfile = false;
                    break;
            }

            switch (((ComboBoxItem)NetworkCostTypeComboBox.SelectedItem).Content.ToString())
            {
                case "Unrestricted":
                    filter.NetworkCostType = NetworkCostType.Unrestricted;
                    break;
                case "Fixed":
                    filter.NetworkCostType = NetworkCostType.Fixed;
                    break;
                case "Variable":
                    filter.NetworkCostType = NetworkCostType.Variable;
                    break;
                case "Unknown":
                    filter.NetworkCostType = NetworkCostType.Unknown;
                    break;
            }

            if (Guid.TryParse(ServiceProviderGuidTextBox.Text, out serviceProviderGuid))
            {
                filter.ServiceProviderGuid = serviceProviderGuid;
            }

            NetworkInformation.FindConnectionProfilesAsync(filter).Completed = FindConnectionProfilesCompletedHandler;
        }
示例#2
0
		/// <summary>
		/// Returns an array of ConnectionProfile objects that match the
		/// filtering criteria defined by ConnectionProfileFilter.
		/// </summary>
		/// <param name="pProfileFilter">Provides the filtering criteria.</param>
		/// <returns>An array of ConnectionProfile objects.</returns>
		public static IAsyncOperation<IReadOnlyList<ConnectionProfile>> FindConnectionProfilesAsync(ConnectionProfileFilter pProfileFilter)
		{
			throw new NotImplementedException();
		}