public AudioControllerPluginConfigViewModel(PluginSystem.IPlugin Plugin, PluginSystem.PluginConfig PluginConfig) : base(Plugin, PluginConfig) { Uri uri = new Uri("pack://application:,,,/LauncherSilo.AudioControllerPlugin;component/AudioControllerPluginResource.xaml"); StreamResourceInfo info = Application.GetResourceStream(uri); XamlReader reader = new XamlReader(); var dictionary = reader.LoadAsync(info.Stream) as ResourceDictionary; PluginConfigControlTemplate = dictionary["AudioControllerPluginConfigView"] as ControlTemplate; NAudio.CoreAudioApi.MMDeviceEnumerator enumerator = new NAudio.CoreAudioApi.MMDeviceEnumerator(); NAudio.CoreAudioApi.MMDeviceCollection endPoints = enumerator.EnumerateAudioEndPoints(NAudio.CoreAudioApi.DataFlow.All, NAudio.CoreAudioApi.DeviceState.All); foreach (NAudio.CoreAudioApi.MMDevice endPoint in endPoints) { if (endPoint.State == NAudio.CoreAudioApi.DeviceState.NotPresent) { continue; } if (endPoint.DataFlow == NAudio.CoreAudioApi.DataFlow.Render) { AudioPlaybackDeviceVM.Add(new AudioDeviceViewModel(endPoint)); } else if (endPoint.DataFlow == NAudio.CoreAudioApi.DataFlow.Capture) { AudioCaptureDeviceVM.Add(new AudioDeviceViewModel(endPoint)); } } }
public FileFinderPluginConfigViewModel(PluginSystem.IPlugin Plugin, PluginSystem.PluginConfig PluginConfig) : base(Plugin, PluginConfig) { Uri uri = new Uri("pack://application:,,,/LauncherSilo.FileFinderPlugin;component/FileFinderPluginResource.xaml"); StreamResourceInfo info = Application.GetResourceStream(uri); XamlReader reader = new XamlReader(); var dictionary = reader.LoadAsync(info.Stream) as ResourceDictionary; PluginConfigControlTemplate = dictionary["FileFinderPluginConfigView"] as ControlTemplate; }
public PluginConfigViewModel(PluginSystem.IPlugin Plugin, PluginSystem.PluginConfig PluginConfig) { _Plugin = Plugin; _PluginConfig = PluginConfig; }