Inheritance: MediaPortal.GUI.Library.GUIInternalWindow, IRenderLayer
コード例 #1
0
ファイル: MpDialogsHelper.cs プロジェクト: johanj/WifiRemote
 /// <summary>
 /// Get the internal dialog object from the given GUIDialogWindow
 /// </summary>
 /// <param name="dialog">Dialog</param>
 /// <returns>WifiRemote MP Dialog</returns>
 public static MpDialog GetDialog(GUIDialogWindow dialog)
 {
     if (dialog.GetType().Equals(typeof(GUIDialogOK)))
     {
         return GetDialogOk();
     }
     else if (dialog.GetType().Equals(typeof(GUIDialogYesNo)))
     {
         return GetDialogYesNo();
     }
     else if (dialog.GetType().Equals(typeof(GUIDialogMenu)))
     {
         return GetDialogMenu();
     }
     else if (dialog.GetType().Equals(typeof(GUIDialogNotify)))
     {
         return GetDialogNotify();
     }
     else if (dialog.GetType().Equals(typeof(GUIDialogProgress)))
     {
         return GetDialogProgress();
     }
     else if (dialog.GetType().Equals(typeof(GUIDialogSetRating)))
     {
         return GetDialogRating();
     }
     else if (dialog.GetType().Equals(typeof(GUIDialogSelect)))
     {
         return GetDialogSelect();
     }
     if (WifiRemote.IsAvailableTVSeries)
     {
         if (TVSeriesHelper.IsTvSeriesRatingDialog(dialog))
         {
             return GetDialogMpTvSeriesRating();
         }
         if (TVSeriesHelper.IsTvSeriesPinDialog(dialog))
         {
             return GetDialogMpTvSeriesPin();
         }
     }
     if (WifiRemote.IsAvailableMovingPictures)
     {
         if (MovingPicturesHelper.IsMovingPictureRatingDialog(dialog))
         {
             return GetDialogMovingPicturesRating();
         }
         else if (MovingPicturesHelper.IsMovingPicturePinDialog(dialog))
         {
             return GetDialogMovingPicturesPin();
         }
     }
     return null;
 }
コード例 #2
0
ファイル: MpDialog.cs プロジェクト: Kucheek/WifiRemote
 /// <summary>
 /// Gets the dialog heading from the given mp dialog and saves it into this instance
 /// </summary>
 /// <param name="dialog">MP Dialog</param>
 /// <param name="controlId">Control id of heading label</param>
 public void GetHeading(GUIDialogWindow dialog, params int[] controlIds)
 {
     this.Heading = GetLabel(dialog, controlIds);
 }
コード例 #3
0
ファイル: MpDialog.cs プロジェクト: Kucheek/WifiRemote
 public MpDialog(GUIDialogWindow _dialog)
     : this()
 {
     dialogWindow = _dialog;
 }
コード例 #4
0
ファイル: MpDialog.cs プロジェクト: Kucheek/WifiRemote
        private string GetSingleLabel(GUIDialogWindow dialog, int control)
        {
            GUIControlCollection coll = dialog.controlList;
            foreach (GUIControl c in coll)
            {
                if (c.GetType() == typeof(GUIGroup))
                {
                    foreach (GUIControl subControl in ((GUIGroup)c).Children)
                    {
                        if (subControl.GetID == control)
                        {
                            return GetSingleLabelFromControl(subControl);
                        }
                    }
                }
                else if (c.GetID == control)
                {
                    return GetSingleLabelFromControl(c);
                }
            }

            return null;
        }
コード例 #5
0
ファイル: MpDialog.cs プロジェクト: Kucheek/WifiRemote
 /// <summary>
 /// Gets the dialog text from the given mp dialog and saves it into this instance
 /// </summary>
 /// <param name="dialog">MP Dialog</param>
 /// <param name="controlId">Control id of text label</param>
 public void GetText(GUIDialogWindow dialog, params int[] controlIds)
 {
     this.DialogText = GetLabel(dialog, controlIds);
 }
コード例 #6
0
ファイル: MpDialog.cs プロジェクト: Kucheek/WifiRemote
        /// <summary>
        /// Gets the text from the given control id on the dialog and returns it
        /// </summary>
        /// <param name="dialog">MP Dialog</param>
        /// <param name="controlId">ID of the label</param>
        /// <returns></returns>
        public String GetLabel(GUIDialogWindow dialog, params int[] controlIds)
        {
            try
            {
                int index = 0;
                StringBuilder text = new StringBuilder();
                foreach (int control in controlIds)
                {
                    String t = GetSingleLabel(dialog, control);
                    if (t != null && !t.Equals(""))
                    {
                        if (index > 0)
                        {
                            text.AppendLine();
                        }
                        index++;

                        text.Append(t);
                    }
                }

                return text.ToString();
            }
            catch (Exception ex)
            {
                WifiRemote.LogMessage("Error filling dialog: " + ex, WifiRemote.LogType.Error);
            }
            return null;
        }
コード例 #7
0
ファイル: MpDialogsHelper.cs プロジェクト: Kucheek/WifiRemote
        /// <summary>
        /// Get the WifiRemote message from the given dialog
        /// </summary>
        /// <param name="dialog">The MP dialog</param>
        /// <returns>WifiRemote dialog message</returns>
        internal static Messages.MessageDialog GetDialogMessage(GUIDialogWindow dialog)
        {
            MpDialog diag = MpDialogsHelper.GetDialog(dialog);
            MessageDialog message = new MessageDialog();
            message.DialogShown = true;
            message.Dialog = diag;

            return message;
        }
コード例 #8
0
ファイル: MpDialog.cs プロジェクト: johanj/WifiRemote
 private string GetSingleLabel(GUIDialogWindow dialog, int control)
 {
     GUIControlCollection coll = dialog.controlList;
     foreach (GUIControl c in coll)
     {
         if (c.GetID == control)
         {
             if (c.GetType() == typeof(GUILabelControl))
             {
                 GUILabelControl l = (GUILabelControl)c;
                 return l.Label;
             }
             else if (c.GetType() == typeof(GUIFadeLabel))
             {
                 GUIFadeLabel l = (GUIFadeLabel)c;
                 return l.Label;
             }
         }
     }
     return null;
 }