public Runner() { Console.Write("TestDvDeviceCs - starting\n"); DeviceBasic device = new DeviceBasic(); iDeviceList = new List<CpDevice>(); CpDeviceList.ChangeHandler added = new CpDeviceList.ChangeHandler(DeviceAdded); CpDeviceList.ChangeHandler removed = new CpDeviceList.ChangeHandler(DeviceRemoved); CpDeviceListUpnpServiceType list = new CpDeviceListUpnpServiceType("openhome.org", "TestBasic", 1, added, removed); Semaphore sem = new Semaphore(0, 1); sem.WaitOne(1000); Debug.Assert(iDeviceList.Count == 1); TestBasicCp cp = new TestBasicCp(iDeviceList[0]); cp.TestActions(); cp.TestSubscriptions(); list.Dispose(); lock (this) { for (int i = 0; i < iDeviceList.Count; i++) { iDeviceList[i].RemoveRef(); } } device.Dispose(); Console.Write("TestDvDeviceCs - completed\n"); }
public Runner() { Console.Write("TestDvDeviceCs - starting\n"); DeviceBasic device = new DeviceBasic(); iDeviceList = new List <CpDevice>(); CpDeviceList.ChangeHandler added = new CpDeviceList.ChangeHandler(DeviceAdded); CpDeviceList.ChangeHandler removed = new CpDeviceList.ChangeHandler(DeviceRemoved); CpDeviceListUpnpServiceType list = new CpDeviceListUpnpServiceType("openhome.org", "TestBasic", 1, added, removed); Semaphore sem = new Semaphore(0, 1); sem.WaitOne(1000); Debug.Assert(iDeviceList.Count == 1); TestBasicCp cp = new TestBasicCp(iDeviceList[0]); cp.TestActions(); cp.TestSubscriptions(); list.Dispose(); lock (this) { for (int i = 0; i < iDeviceList.Count; i++) { iDeviceList[i].RemoveRef(); } } device.Dispose(); Console.Write("TestDvDeviceCs - completed\n"); }
public static void Main(string[] args) { Console.WriteLine("TestPerformanceDvCs - starting ('q' to quit)"); InitParams initParams = new InitParams(); using (Library lib = Library.Create(initParams)) { lib.StartDv(); DeviceBasic device = new DeviceBasic(); while (Console.ReadKey(true).KeyChar != 'q') ; device.Dispose(); } }
public static void Main(string[] args) { Console.WriteLine("TestPerformanceDvCs - starting ('q' to quit)"); InitParams initParams = new InitParams(); using (Library lib = Library.Create(initParams)) { lib.StartDv(); DeviceBasic device = new DeviceBasic(); while (Console.ReadKey(true).KeyChar != 'q') { ; } device.Dispose(); } }