Change to Explicit Program Class
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
|
|
||||||
using FlashCap;
|
|
||||||
|
|
||||||
var device = new CaptureDevices();
|
|
||||||
var descriptors = device.GetDescriptors().Where(x=>x.Characteristics.Length > 0).ToList();
|
|
||||||
var deviceIndex = -1;
|
|
||||||
while (deviceIndex == -1)
|
|
||||||
{
|
|
||||||
PrintDevices(descriptors);
|
|
||||||
var input = Console.ReadLine();
|
|
||||||
int.TryParse(input, out var result);
|
|
||||||
if (result<1 || result>descriptors.Count)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
deviceIndex = result-1;
|
|
||||||
}
|
|
||||||
var captureDescriptor = descriptors[deviceIndex];
|
|
||||||
Console.WriteLine($"Characteristics:\n\t{string.Join("\n\t",captureDescriptor.Characteristics)}");
|
|
||||||
return;
|
|
||||||
|
|
||||||
void PrintDevices(List<CaptureDeviceDescriptor> captureDeviceDescriptors)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Choose your Device:");
|
|
||||||
for (var index = 0; index < captureDeviceDescriptors.Count; index++)
|
|
||||||
{
|
|
||||||
var descriptor = captureDeviceDescriptors[index];
|
|
||||||
Console.WriteLine($"\t({index+1}): {descriptor.Name}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
36
Flashcap-Demo/Program.cs
Normal file
36
Flashcap-Demo/Program.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
using FlashCap;
|
||||||
|
|
||||||
|
namespace Flashcap_Demo;
|
||||||
|
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
var device = new CaptureDevices();
|
||||||
|
var deviceDescriptors = device.GetDescriptors().Where(x=>x.Characteristics.Length > 0).ToList();
|
||||||
|
var deviceIndex = -1;
|
||||||
|
while (deviceIndex == -1)
|
||||||
|
{
|
||||||
|
PrintDevices(deviceDescriptors);
|
||||||
|
var input = Console.ReadLine();
|
||||||
|
int.TryParse(input, out var result);
|
||||||
|
if (result<1 || result>deviceDescriptors.Count)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
deviceIndex = result-1;
|
||||||
|
}
|
||||||
|
var captureDescriptor = deviceDescriptors[deviceIndex];
|
||||||
|
Console.WriteLine($"Characteristics:\n\t{string.Join("\n\t",captureDescriptor.Characteristics)}");
|
||||||
|
}
|
||||||
|
private static void PrintDevices(List<CaptureDeviceDescriptor> descriptors)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Choose your Device:");
|
||||||
|
for (var index = 0; index < descriptors.Count; index++)
|
||||||
|
{
|
||||||
|
var descriptor = descriptors[index];
|
||||||
|
Console.WriteLine($"\t({index+1}): {descriptor.Name}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user