/// <summary> /// Returns the display from a submenu to its parent menu /// </summary> public void ReturnFromSubmenu() { VerifyAccess(); if (m_dvdControl == null) { return; } IDvdCmd cmd; m_dvdControl.ReturnFromSubmenu(DvdCmdFlags.None, out cmd); if (cmd != null) { Marshal.ReleaseComObject(cmd); } }
void TestMenusAndButtons() { int hr; IDvdCmd ppCmd; DvdDomain dvdd; int pulButtonsAvailable; int pulCurrentButton; // Top menu hr = m_idc2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); Application.DoEvents(); hr = m_idi2.GetCurrentDomain(out dvdd); DsError.ThrowExceptionForHR(hr); Debug.Assert(dvdd == DvdDomain.VideoManagerMenu, "TestMenusAndButtons"); hr = m_idc2.SelectButton(2); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); Application.DoEvents(); hr = m_idi2.GetCurrentButton(out pulButtonsAvailable, out pulCurrentButton); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulCurrentButton == 2, "TestMenusAndButtons2"); Debug.Assert(pulButtonsAvailable == 2, "TestMenusAndButtons2a"); // Button 1 leads to a chapter menu with 2 items hr = m_idc2.SelectButton(1); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); Application.DoEvents(); hr = m_idc2.ActivateButton(); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.ReturnFromSubmenu(DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.SelectRelativeButton(DvdRelativeButton.Lower); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idi2.GetCurrentButton(out pulButtonsAvailable, out pulCurrentButton); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulCurrentButton == 2, "TestMenusAndButtons2"); hr = m_idc2.SelectAndActivateButton(1); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.SelectButton(2); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.SelectAtPosition(new Point(130, 130)); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idi2.GetCurrentButton(out pulButtonsAvailable, out pulCurrentButton); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulCurrentButton == 1, "TestMenusAndButtons2"); hr = m_idc2.ReturnFromSubmenu(DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.ActivateAtPosition(new Point(130, 130)); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); }