<commit_before>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Gablarski.Audio;

namespace Gablarski
{
	public partial class DeviceSelector
		: UserControl
	{
		public DeviceSelector ()
		{
			InitializeComponent ();

			this.provider.DisplayMember = "Name";
		}

		public IEnumerable<Type> ProviderSource
		{
			set
			{
				this.provider.DataSource = value.ToList();
			}
		}

		public Type Provider
		{
			get { return (provider.SelectedItem != null) ? (Type)provider.SelectedItem : null; }
		}

		public IAudioDevice Device
		{
			get { return (device.SelectedItem != null) ? (IAudioDevice)device.SelectedItem : null; }
		}

		public void SetProvider (string providerName)
		{
			if (String.IsNullOrEmpty (providerName))
				return;

			provider.SelectedItem = provider.Items.Cast<Type>().FirstOrDefault (d => d.AssemblyQualifiedName == providerName);
		}

		public void SetDevice (string deviceName)
		{
			if (String.IsNullOrEmpty (deviceName))
				return;

			device.SelectedItem = device.Items.Cast<IAudioDevice>().FirstOrDefault (d => d.Name == deviceName);
		}

		private void provider_SelectedIndexChanged (object sender, EventArgs e)
		{
			this.device.Items.Clear();

			if (this.provider.SelectedItem == null)
				this.device.Enabled = false;
			else
			{
				this.device.Enabled = true;
				using (var p = ((IAudioDeviceProvider)Activator.CreateInstance (Provider)))
				{
					this.device.DataSource = p.GetDevices().ToList();
					this.device.SelectedItem = p.DefaultDevice;
				}
			}
		}
	}
}
<commit_msg> * Fixed #99<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Gablarski.Audio;

namespace Gablarski
{
	public partial class DeviceSelector
		: UserControl
	{
		public DeviceSelector ()
		{
			InitializeComponent ();

			this.provider.DisplayMember = "Name";
		}

		public IEnumerable<Type> ProviderSource
		{
			set
			{
				this.provider.DataSource = value.ToList();
			}
		}

		public Type Provider
		{
			get { return (provider.SelectedItem != null) ? (Type)provider.SelectedItem : null; }
		}

		public IAudioDevice Device
		{
			get { return (device.SelectedItem != null) ? (IAudioDevice)device.SelectedItem : null; }
		}

		public void SetProvider (string providerName)
		{
			if (String.IsNullOrEmpty (providerName))
				return;

			provider.SelectedItem = provider.Items.Cast<Type>().FirstOrDefault (d => d.AssemblyQualifiedName == providerName);
		}

		public void SetDevice (string deviceName)
		{
			if (String.IsNullOrEmpty (deviceName))
				return;

			device.SelectedItem = device.Items.Cast<IAudioDevice>().FirstOrDefault (d => d.Name == deviceName);
		}

		private void provider_SelectedIndexChanged (object sender, EventArgs e)
		{
			this.device.DataSource = null;

			if (this.provider.SelectedItem == null)
				this.device.Enabled = false;
			else
			{
				this.device.Enabled = true;
				using (var p = ((IAudioDeviceProvider)Activator.CreateInstance (Provider)))
				{
					this.device.DataSource = p.GetDevices().ToList();
					this.device.SelectedItem = p.DefaultDevice;
				}
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.11018651362984218, 'fraction_numerical': 0.0005738880918220947, 'mean_word_length': 3.048780487804878, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4491234', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1056, 'n_words': 217}