我有两种静态方法:
ToArray()
和
while (object.children.length)
{
object.children.remove(object.children[0]);
}
并使用:
public class RenderDevice
public static async Task<List<DeviceInformation>> GetDeviceNames()
{
DeviceInformationCollection dir = await DeviceInformation.FindAllAsync(MediaDevice.GetAudioRenderSelector());
return dir.AsEnumerable().ToList();
}
}
我有时会在public class CaptureDevice
public static async Task<List<DeviceInformation>> GetCaptureDeviceNames()
{
DeviceInformationCollection dir = await DeviceInformation.FindAllAsync(MediaDevice.GetAudioCaptureSelector());
return dir.AsEnumerable().ToList();
}
开始有时停机,有时会在第二个var renderDevices = RenderDevice.GetDeviceNames();
renderDevices.Wait();
var captureDevices = CaptureDevice.GetDeviceNames();
captureDevices.Wait();
停机
看起来像.Wait()
的问题或者我做错了什么?