コード例 #1
0
 private void MenuStartCloseMp_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         bool isMpRunning = userSessionService.IsMediaPortalRunning().Result;
         if (!isMpRunning)
         {
             userSessionService.StartMediaPortal();
             HandleMpState(true);
         }
         else
         {
             userSessionService.CloseMediaPortal();
             HandleMpState(false);
         }
     }
     catch (Exception ex)
     {
         Log.Warn("Exception while trying to start/stop MediaPortal", ex);
     }
 }