public int SetDefaultDevice(string deviceID) { _policyConfigVistaClient.SetDefaultEndpoint(deviceID, ERole.eConsole); _policyConfigVistaClient.SetDefaultEndpoint(deviceID, ERole.eMultimedia); _policyConfigVistaClient.SetDefaultEndpoint(deviceID, ERole.eCommunications); return(0); }
public static void SetDefaultEndpoint(string devId, ERole eRole) { object o = (object)null; try { o = GetPolicyConfig(); IPolicyConfigX policyConfigX = o as IPolicyConfigX; IPolicyConfig policyConfig = o as IPolicyConfig; IPolicyConfigVista policyConfigVista = o as IPolicyConfigVista; if (policyConfig != null) { policyConfig.SetDefaultEndpoint(devId, eRole); } else if (policyConfigVista != null) { policyConfigVista.SetDefaultEndpoint(devId, eRole); } else { policyConfigX?.SetDefaultEndpoint(devId, eRole); } } finally { if (o != null && Marshal.IsComObject(o)) { Marshal.FinalReleaseComObject(o); } GC.Collect(); } }
public void SetDefaultEndpoint(string devID, DeviceRoles eRole) { if (_PolicyConfig != null) { Marshal.ThrowExceptionForHR(_PolicyConfig.SetDefaultEndpoint(devID, eRole)); return; } if (_PolicyConfigVista != null) { Marshal.ThrowExceptionForHR(_PolicyConfigVista.SetDefaultEndpoint(devID, eRole)); return; } if (_PolicyConfig10 != null) { Marshal.ThrowExceptionForHR(_PolicyConfig10.SetDefaultEndpoint(devID, eRole)); } }
public void SetDefaultEndpoint(string deviceId, NAudio.CoreAudioApi.Role role) { if (_PolicyConfig != null) { Marshal.ThrowExceptionForHR(_PolicyConfig.SetDefaultEndpoint(deviceId, role)); return; } if (_PolicyConfigVista != null) { Marshal.ThrowExceptionForHR(_PolicyConfigVista.SetDefaultEndpoint(deviceId, role)); return; } if (_PolicyConfig10 != null) { Marshal.ThrowExceptionForHR(_PolicyConfig10.SetDefaultEndpoint(deviceId, role)); } }
public void SetDefaultEndpoint(string wszDeviceId, ERole eRole) { Marshal.ThrowExceptionForHR(_RealPolicyConfigVista.SetDefaultEndpoint(wszDeviceId, eRole)); }
public int SetDefaultDevice(string deviceID, ERole role) { _policyConfigVistaClient.SetDefaultEndpoint(deviceID, role); return(0); }