Ejemplo n.º 1
0
        /// <summary>
        /// Get WifiRemote representation of the rating dialog
        /// </summary>
        /// <returns>WifiRemote Dialog Instance</returns>
        public static MpDialogRating GetDialogRating()
        {
            GUIDialogSetRating menu         = (GUIDialogSetRating)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_RATING);
            MpDialogRating     notifyDialog = new MpDialogRating(menu);

            return(notifyDialog);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Get WifiRemote representation of the rating dialog
 /// </summary>
 /// <returns>WifiRemote Dialog Instance</returns>
 public static MpDialogRating GetDialogRating()
 {
     GUIDialogSetRating menu = (GUIDialogSetRating)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_RATING);
     MpDialogRating notifyDialog = new MpDialogRating(menu);
     return notifyDialog;
 }
        /// <summary>
        /// Handle the dialog action
        /// </summary>
        /// <param name="message">Message from Client</param>
        internal static void HandleDialogAction(Newtonsoft.Json.Linq.JObject message, SocketServer server, AsyncSocket client)
        {
            String action   = (string)message["ActionType"];
            int    dialogId = (int)message["DialogId"];
            int    index    = (int)message["Index"];

            if (action.Equals("get"))
            {
                if (MpDialogsHelper.IsDialogShown)
                {
                    MessageDialog msg = MpDialogsHelper.GetDialogMessage(MpDialogsHelper.CurrentDialog);
                    server.SendMessageToClient(msg, client);
                }
                else
                {
                    MessageDialog msg = new MessageDialog();
                    msg.DialogShown = false;
                    server.SendMessageToClient(msg, client);
                }
            }
            else
            {
                if (dialogId == (int)GUIWindow.Window.WINDOW_DIALOG_MENU)
                {
                    MpDialogMenu diag = MpDialogsHelper.GetDialogMenu();
                    diag.HandleAction(action, index);
                }
                else if (dialogId == (int)GUIWindow.Window.WINDOW_DIALOG_OK)
                {
                    MpDialogOk diag = MpDialogsHelper.GetDialogOk();
                    diag.HandleAction(action, index);
                }
                else if (dialogId == (int)GUIWindow.Window.WINDOW_DIALOG_YES_NO)
                {
                    MpDialogYesNo diag = MpDialogsHelper.GetDialogYesNo();
                    diag.HandleAction(action, index);
                }
                else if (dialogId == (int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY)
                {
                    MpDialogNotify diag = MpDialogsHelper.GetDialogNotify();
                    diag.HandleAction(action, index);
                }
                else if (dialogId == (int)GUIWindow.Window.WINDOW_DIALOG_PROGRESS)
                {
                    MpDialogProgress diag = MpDialogsHelper.GetDialogProgress();
                    diag.HandleAction(action, index);
                }
                else if (dialogId == (int)GUIWindow.Window.WINDOW_DIALOG_RATING)
                {
                    MpDialogRating diag = MpDialogsHelper.GetDialogRating();
                    diag.HandleAction(action, index);
                }
                else if (dialogId == MpDialogsHelper.TVSERIES_RATING_ID)
                {
                    if (WifiRemote.IsAvailableTVSeries)
                    {
                        MpDialogTvSeriesRating diag = MpDialogsHelper.GetDialogMpTvSeriesRating();
                        diag.HandleAction(action, index);
                    }
                }
                else if (dialogId == MpDialogsHelper.TVSERIES_PIN_ID)
                {
                    if (WifiRemote.IsAvailableTVSeries)
                    {
                        MpDialogTvSeriesPin diag = MpDialogsHelper.GetDialogMpTvSeriesPin();
                        diag.HandleAction(action, index);
                    }
                }
                else if (dialogId == MpDialogsHelper.MOPI_RATING_ID)
                {
                    if (WifiRemote.IsAvailableMovingPictures)
                    {
                        MpDialogMovingPicturesRating diag = MpDialogsHelper.GetDialogMovingPicturesRating();
                        diag.HandleAction(action, index);
                    }
                }
                else if (dialogId == MpDialogsHelper.MOPI_PIN_ID)
                {
                    if (WifiRemote.IsAvailableMovingPictures)
                    {
                        MpDialogMovingPicturesPin diag = MpDialogsHelper.GetDialogMovingPicturesPin();
                        diag.HandleAction(action, index);
                    }
                }
                else if (dialogId == MpDialogsHelper.TRAKT_RATING_ID)
                {
                    if (WifiRemote.IsAvailableTrakt)
                    {
                        MpDialogTraktRating dialog = MpDialogsHelper.GetDialogTraktRating();
                        dialog.HandleAction(action, index);
                    }
                }
            }
        }