The implementation of a GUIListControl
Inheritance: GUIControl
コード例 #1
0
ファイル: NavigationObject.cs プロジェクト: drtak34/my-films
        public NavigationObject(GUIListControl control, string title, string itemtype, string nbobjects, string moviecontext, int pos, 
            MyFilms.Layout curview, Configuration curconf, GUISortButtonControl srtButton, GUIButtonControl viewButton, GUIButtonControl layoutButton,
            CoverState coverstate, DateTime lastDBupdate)
        {
            Items = new List<GUIListItem>();
              GetItems(control, title, itemtype, pos, curview);
              ViewStatus = new ViewState();
              GetViewStatus(curconf);

              DbDfltSelect = curconf.DbSelection[0];
              DbSelect = curconf.DbSelection[1];
              DbField = curconf.DbSelection[2];
              DbSort = curconf.DbSelection[3];
              bool showall;
              DbShowAll = (Boolean.TryParse(curconf.DbSelection[4], out showall)) && showall;
              bool extrasort;
              DbExtraSort = (Boolean.TryParse(curconf.DbSelection[4], out extrasort)) && extrasort;

              NbObjects = nbobjects;
              MovieContext = moviecontext;

              CurrentView = curview;

              SortButtonEnabled = srtButton.IsEnabled;
              SortButtonAsc = srtButton.IsAscending;
              SortButtonLabel = srtButton.Label;
              ViewAsButtonLabel = viewButton.Label;
              LayoutButtonLabel = layoutButton.Label;
              CoverStatus = coverstate;
              LastDbUpdate = lastDBupdate;
        }
コード例 #2
0
 public void GetItems(GUIListControl control, string tit, int pos, View curview)
 {
     Title = tit;
       Position = pos;
       CurrentView = curview;
       Items = control.ListItems.GetRange(0, control.ListItems.Count);
 }
コード例 #3
0
ファイル: NavigationObject.cs プロジェクト: drtak34/my-films
 public void GetItems(GUIListControl control, string title, string itemtype, int pos, MyFilms.Layout curview)
 {
     Title = title;
       Position = pos;
       CurrentView = curview;
       ItemType = itemtype;
       Items = control.ListItems.GetRange(0, control.ListItems.Count);
 }
コード例 #4
0
        private void AddRangeToList(GUIListControl listControl, List<GUIListItem> listItems)
        {
            listControl.Clear();

            foreach (var item in listItems) {
                listControl.Add(item);
            }
        }
コード例 #5
0
ファイル: mpFunctions.cs プロジェクト: DustinBrett/mpNZB
    public void UpdateListItem(int index, GUIListControl _List, string _Label, string _Label2, string _DVDLabel, DateTime _CreationTime, long _Length, string _Name, string _Path, int _ItemId)
    {
        if (_List.Count <= index)
        {
            return;
        }

        // Set Item Information
        _List.ListItems[index].Label = _Label;
        _List.ListItems[index].Label2 = _Label2;
        _List.ListItems[index].DVDLabel = _DVDLabel;
        _List.ListItems[index].Path = _Path;
        _List.ListItems[index].ItemId = _ItemId;

        // Set File Information
        _List.ListItems[index].FileInfo = new MediaPortal.Util.FileInformation();
        _List.ListItems[index].FileInfo.CreationTime = _CreationTime;
        _List.ListItems[index].FileInfo.Length = _Length;
        _List.ListItems[index].FileInfo.Name = _Name;        

    }
コード例 #6
0
ファイル: mpFunctions.cs プロジェクト: DustinBrett/mpNZB
    public void ListItem(GUIListControl _List, string _Label, string _Label2, string _DVDLabel, DateTime _CreationTime, long _Length, string _Name, string _Path, int _ItemId)
    {
      // Init Item
      GUIListItem Item = new GUIListItem();

      // Set Item Information
      Item.Label = _Label;
      Item.Label2 = _Label2;
      Item.DVDLabel = _DVDLabel;
      Item.Path = _Path;
      Item.ItemId = _ItemId;

      // Set File Information
      Item.FileInfo = new MediaPortal.Util.FileInformation();
      Item.FileInfo.CreationTime = _CreationTime;
      Item.FileInfo.Length = _Length;
      Item.FileInfo.Name = _Name;

      // Add Item to List
      _List.Add(Item);
    }
コード例 #7
0
    private GUIListControl getChannelList()
    {
      GUIListControl lstChannels = null;

      if (TVHome.ShowChannelStateIcons() && lstChannelsWithStateIcons != null)
      {
        lstChannels = lstChannelsWithStateIcons;
      }
      else
      {
        lstChannels = lstChannelsNoStateIcons;
      }

      return lstChannels;
    }
コード例 #8
0
ファイル: Sites.cs プロジェクト: DustinBrett/mpNZB
        public void AddItem(XmlNode _Node, GUIListControl _List)
        {
            try
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(MediaPortal.Configuration.Config.GetFolder(MediaPortal.Configuration.Config.Dir.Plugins) + @"\Windows\Sites.xml");

                string strSize = String.Empty;
                double dblSize = 0;

                if (xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size") != null)
                {
                    switch (int.Parse(xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size").Attributes["type"].InnerText))
                    {
                        case 1:
                            Match mSize = Regex.Match(((xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size[@attribute]") != null) ? _Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size").Attributes["element"].InnerText].Attributes[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size").Attributes["attribute"].InnerText].InnerText : _Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size").Attributes["element"].InnerText].InnerText), @"(\d+[,.]?\d+)\s?(b|byte|bytes|B|kb|kilobyte|kilobytes|KB|KiB|mb|megabyte|megabytes|MB|MiB|gb|gigabyte|gigabytes|GB|GiB|tb|terabyte|terabytes|TB|TiB)");
                            if ((mSize.Success) && (mSize.Groups[1].Value.Length > 0) && (mSize.Groups[2].Value.Length > 0))
                            {
                                dblSize = double.Parse(Regex.Replace(mSize.Groups[1].Value, "[(.|,)]", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator.ToCharArray()[0].ToString()));
                                switch (mSize.Groups[2].Value.Replace("KiB", "KB").Replace("MiB", "MB").Replace("GiB", "GB").Replace("TiB", "TB"))
                                {
                                    case "KB":
                                        dblSize = (dblSize * 1024);
                                        break;
                                    case "MB":
                                        dblSize = ((dblSize * 1024) * 1024);
                                        break;
                                    case "GB":
                                        dblSize = (((dblSize * 1024) * 1024) * 1024);
                                        break;
                                    case "TB":
                                        dblSize = ((((dblSize * 1024) * 1024) * 1024) * 1024);
                                        break;
                                }
                            }
                            break;
                        case 2:
                            dblSize = ((xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size[@attribute]") != null) ? double.Parse(_Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size").Attributes["element"].InnerText].Attributes[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size").Attributes["attribute"].InnerText].InnerText) : double.Parse(_Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/size").Attributes["element"].InnerText].InnerText));
                            break;
                    }

                    if (dblSize == 0) { strSize = String.Empty; }
                    else if (dblSize < 1024) { strSize = dblSize.ToString("N2") + " B"; }
                    else if (dblSize < 1048576) { strSize = (dblSize / 1024).ToString("N2") + " KB"; }
                    else if (dblSize < 1073741824) { strSize = ((dblSize / 1024) / 1024).ToString("N2") + " MB"; }
                    else if (dblSize < 1099511627776) { strSize = (((dblSize / 1024) / 1024) / 1024).ToString("N2") + " GB"; }
                    else if (dblSize < 1125899906842624) { strSize = ((((dblSize / 1024) / 1024) / 1024) / 1024).ToString("N2") + " TB"; }
                }

                string strURL = ((xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/url[@attribute]") != null) ? _Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/url").Attributes["element"].InnerText].Attributes[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/url").Attributes["attribute"].InnerText].InnerText : _Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/url").Attributes["element"].InnerText].InnerText);
                if (xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/url/regex") != null)
                {
                    foreach (XmlNode _RegEx in xmlDoc.SelectNodes("sites/site[@name='" + SiteName + "']/item/url/regex"))
                    {
                        strURL = Regex.Replace(strURL, _RegEx.Attributes["input"].InnerText, _RegEx.Attributes["replacement"].InnerText);
                    }
                }

                DateTime dtPubDate = new DateTime();
                if (_Node.SelectSingleNode("pubDate") != null)
                {
                    DateTime.TryParseExact(_Node["pubDate"].InnerText.Replace("GMT", "+0000"), "ddd, dd MMM yyyy HH:mm:ss zzz", CultureInfo.InvariantCulture, DateTimeStyles.None, out dtPubDate);
                }

                string strNZBInfo = String.Empty;
                string strNFOLink = String.Empty;

                switch (SiteName)
                {
                    case "Newzbin":
                        if (_Node["report:attributes"] != null)
                        {
                            string Source = String.Empty;
                            string VideoFmt = String.Empty;
                            string VideoGenre = String.Empty;
                            string Language = String.Empty;
                            string Subtitles = String.Empty;

                            XmlNodeList Attributes = _Node["report:attributes"].ChildNodes;
                            if (Attributes.Count > 0)
                            {
                                foreach (XmlNode Attribute in Attributes)
                                {
                                    switch (Attribute.Attributes[0].InnerText)
                                    {
                                        case "Source":
                                            Source += ((Source.Length > 0) ? ", " : String.Empty) + Attribute.InnerText;
                                            break;
                                        case "Video Fmt":
                                            VideoFmt += ((VideoFmt.Length > 0) ? ", " : String.Empty) + Attribute.InnerText;
                                            break;
                                        case "Video Genre":
                                            VideoGenre += ((VideoGenre.Length > 0) ? ", " : String.Empty) + Attribute.InnerText;
                                            break;
                                        case "Language":
                                            Language += ((Language.Length > 0) ? ", " : String.Empty) + Attribute.InnerText;
                                            break;
                                        case "Subtitles":
                                            Subtitles += ((Subtitles.Length > 0) ? ", " : String.Empty) + Attribute.InnerText;
                                            break;
                                    }
                                }
                            }

                            strNZBInfo = ((Source.Length > 0) ? "Source: " + Source + Environment.NewLine : String.Empty) + ((VideoFmt.Length > 0) ? "Video Format: " + VideoFmt + Environment.NewLine : String.Empty) + "Video Genre: " + ((VideoGenre.Length > 0) ? VideoGenre + Environment.NewLine : String.Empty) + ((Language.Length > 0) ? "Language: " + Language + Environment.NewLine : String.Empty) + ((Subtitles.Length > 0) ? "Subtitles: " + Subtitles : String.Empty);

                            if (_Node["report:nfo"]["report:link"] != null)
                            {
                                strNFOLink = _Node["report:nfo"]["report:link"].InnerText.Replace("nfo/view/", String.Empty).Replace("www", "nfo");
                            }
                        }
                        break;

                    case "TvNZB":
                    case "MyTvNZB":
                        if ((_Node["season"] != null) && (_Node["episode"] != null))
                        {
                            string Season = _Node["season"].InnerText;
                            string Episode = _Node["episode"].InnerText;

                            strNZBInfo = ((Season.Length > 0) ? "Season: " + Season + Environment.NewLine : String.Empty) + ((Season.Length > 0) ? "Episode: " + Episode : String.Empty);
                        }
                        break;
                }

                MP.ListItem(_List, ((xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/title[@attribute]") != null) ? _Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/title").Attributes["element"].InnerText].Attributes[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/title").Attributes["attribute"].InnerText].InnerText : _Node[xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item/title").Attributes["element"].InnerText].InnerText).Replace("&quot;", "\"").Replace("&amp;", "&").Replace("&lt;", "<").Replace("&gt;", ">"), strSize, strNZBInfo, dtPubDate, (long)dblSize, strNFOLink, strURL, int.Parse(xmlDoc.SelectSingleNode("sites/site[@name='" + SiteName + "']/item").Attributes["type"].InnerText));
            }
            catch (Exception e) { MP.Error(e); }
        }
コード例 #9
0
ファイル: SABnzbd.cs プロジェクト: DustinBrett/mpNZB
    public void Queue(GUIListControl _List, GUIWindow _GUI, bool refocus)
    {
        int selectedIndex = _List.SelectedListItemIndex;

        try
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(new XmlTextReader(CreateURL("api?mode=queue", "output=xml", false)));

            if (xmlDoc.SelectSingleNode("queue/slots") != null)
            {
                if (refocus)
                {
                    _List.Clear();
                }

                NumberFormatInfo nfi = new CultureInfo("en-US", false).NumberFormat;
                string strJobInfo;

                int i = 0;
                foreach (XmlNode nodeItem in xmlDoc.SelectNodes("queue/slots/slot"))
                {
                    strJobInfo = "Status: " + nodeItem["status"].InnerText + Environment.NewLine + "Filename: " + nodeItem["filename"].InnerText + Environment.NewLine + "Priority: " + nodeItem["priority"].InnerText + Environment.NewLine + "Category: " + nodeItem["cat"].InnerText + Environment.NewLine + "Percentage: " + nodeItem["percentage"].InnerText + "%";

                    double mbdone = double.Parse(nodeItem["mb"].InnerText, nfi) - double.Parse(nodeItem["mbleft"].InnerText, nfi);

                    if (_List.Count > i && !refocus)
                    {
                        MP.UpdateListItem(i, _List, nodeItem["filename"].InnerText, ((nodeItem["status"].InnerText == "Paused") ? "Paused" : mbdone.ToString("N2") + " / " + double.Parse(nodeItem["mb"].InnerText, nfi).ToString("N2") + " MB"), strJobInfo, DateTime.Now, 0, String.Empty, nodeItem["nzo_id"].InnerText, 3);
                    }
                    else
                    {
                        MP.ListItem(_List, nodeItem["filename"].InnerText, ((nodeItem["status"].InnerText == "Paused") ? "Paused" : mbdone.ToString("N2") + " / " + double.Parse(nodeItem["mb"].InnerText, nfi).ToString("N2") + " MB"), strJobInfo, DateTime.Now, 0, String.Empty, nodeItem["nzo_id"].InnerText, 3);
                    }

                    ++i;
                }

                GUIPropertyManager.SetProperty("#Status", "Queue Loaded");
            }
            else
            {
                GUIPropertyManager.SetProperty("#Status", "Error parsing XML");
            }
        }
        catch (Exception e) { MP.Error(e); }
        finally
        {
            if (_List.Count > 0 && refocus)
            {
                _GUI.LooseFocus();
                _List.Focus = true;
            }
            else if (_List.IsFocused && _List.Count > selectedIndex)
            {
                _List.SelectedListItemIndex = selectedIndex;
            }
        }
    }
コード例 #10
0
ファイル: ListElement.cs プロジェクト: pilehave/headweb-mp
 /// <summary>
 /// Creates the element and retrieves all information from the control
 /// </summary>
 /// <param name="control">GUIControl</param>
 public ListElement(GUIControl control)
     : base(control)
 {
     _list = control as GUIListControl;
       if (_list != null)
       {
     _cursorX = _list.CursorX;
     _offset = _list.Offset;
     _listButtons = new List<ListButtonElement>();
     _labelControls1 = new List<ListLabelElement>();
     _labelControls2 = new List<ListLabelElement>();
     _labelControls3 = new List<ListLabelElement>();
     _cachedBitmaps = new Dictionary<String, Bitmap>();
     AllocButtons(_list.SpinX, _list.SpinY);
     initializeLabels();
     _verticalScrollBarElement = new VerticalScrollBarElement(_list.Scrollbar);
     _focus = _list.IsFocused;
       }
 }
コード例 #11
0
 private void SelectItemByIndex(int index, GUIListControl listControl)
 {
     while (index >= listControl.Count && index > 0)
     {
         index--;
     }
     GUIControl.SelectItemControl(GetID, listControl.GetID, index);
 }
コード例 #12
0
 private int GetSelectedItemIndex(GUIListControl listControl)
 {
     if (listControl.Count > 0)
     {
         return listControl.SelectedListItemIndex;
     }
     else
     {
         return -1;
     }
 }
コード例 #13
0
 private GUIListItem GetItem(int index, GUIListControl listControl)
 {
     return listControl[index];
 }
コード例 #14
0
ファイル: MpDialogMenu.cs プロジェクト: johanj/WifiRemote
        /// <summary>
        /// Get items from the list control
        /// </summary>
        /// <param name="list">list control</param>
        private void GetItemsFromListControl(GUIListControl list)
        {
            //make sure the list isn't in the progress of being filled (list count growing)
            int itemCount = 0;
            for (int i = 0; i < 20; i++)
            {
                Thread.Sleep(200);

                if (list.Count > 0 && list.Count == itemCount)
                {
                    break;
                }
                itemCount = list.Count;
            }

            WifiRemote.LogMessage("Retrieving " + itemCount + " dialog list items: " , WifiRemote.LogType.Debug);

            List<GUIListItem> items = list.ListItems;
            for (int i = 0; i < itemCount; i++)
            {
                FacadeItem item = new FacadeItem(list[i]);
                //WifiRemote.LogMessage("Add dialog list items: " + item.Label, WifiRemote.LogType.Debug);
                ListItems.Add(item);
            }
        }
コード例 #15
0
ファイル: SABnzbd.cs プロジェクト: DustinBrett/mpNZB
    public void History(GUIListControl _List, GUIWindow _GUI)
    {
      try
      {
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(new XmlTextReader(CreateURL("api?mode=history", "output=xml", false)));

        if (xmlDoc.SelectSingleNode("history/slots") != null)
        {
          _List.Clear();

          string strItemInfo = String.Empty;

          foreach (XmlNode nodeItem in xmlDoc.SelectNodes("history/slots/slot"))
          {
            DateTime dtPubDate = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(double.Parse(nodeItem["completed"].InnerText));

            strItemInfo = String.Empty;

            foreach (XmlNode nodeInfo in nodeItem.SelectNodes("stage_log/slot"))
            {
              strItemInfo += ((strItemInfo.Length > 0) ? Environment.NewLine : String.Empty) + nodeInfo["name"].InnerText + ":" + Environment.NewLine;

              foreach (XmlNode nodeProgress in nodeInfo.SelectNodes("actions/item"))
              {
                strItemInfo += nodeProgress.InnerText + Environment.NewLine;
              }
            }

            MP.ListItem(_List, nodeItem["name"].InnerText, nodeItem["status"].InnerText, strItemInfo, dtPubDate, 0, String.Empty, String.Empty, 4);
          }

          GUIPropertyManager.SetProperty("#Status", "History Loaded");
        }
        else
        {
          GUIPropertyManager.SetProperty("#Status", "Error parsing XML");
        }
      }
      catch (Exception e) { MP.Error(e); }
      finally
      {
        if (_List.Count > 0)
        {
          _GUI.LooseFocus();
          _List.Focus = true;
        }
      }
    }
コード例 #16
0
ファイル: mpNZB.cs プロジェクト: DustinBrett/mpNZB
    private void ReadRSS(List<string> _URL, GUIListControl _List, string _Username, string _Password)
    {
      try
      {
        int intItemCount = 0;
        _List.Clear();

        foreach (string URL in _URL)
        {
          HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(URL);
          webReq.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip");

          if ((_Username.Length > 0) && (_Password.Length > 0)) { webReq.Credentials = new NetworkCredential(_Username, _Password); }

          HttpWebResponse webResp = (HttpWebResponse)webReq.GetResponse();
          XmlDocument xmlDoc = new XmlDocument();
          xmlDoc.Load(((webResp.ContentEncoding.ToLower().Contains("gzip")) ? new GZipStream(webResp.GetResponseStream(), CompressionMode.Decompress, false) : webResp.GetResponseStream()));
          webResp.Close();

          if (xmlDoc.SelectSingleNode("rss[@version='2.0']") != null)
          {
            XmlNodeList xmlNodes = xmlDoc.SelectNodes("rss/channel/item");
            foreach (XmlNode xmlNode in xmlNodes)
            {
              Site.AddItem(xmlNode, _List);
              intItemCount += 1;
            }
          }
          else
          {
            GUIPropertyManager.SetProperty("#Status", "Error parsing XML");
          }
        }

        _List.ListItems.Sort(delegate(GUIListItem _Item1, GUIListItem _Item2) { return _Item2.FileInfo.CreationTime.CompareTo(_Item1.FileInfo.CreationTime); });
        GUIPropertyManager.SetProperty("#Status", "Found " + intItemCount.ToString() + " Items");
      }
      catch (Exception e) { MP.Error(e); }
      finally
      {
        if (_List.Count > 0)
        {
          this.LooseFocus();
          _List.Focus = true;
        }
      }
    }
コード例 #17
0
ファイル: SABnzbd.cs プロジェクト: DustinBrett/mpNZB
    public void QueueItem(GUIListControl _List, GUIWindow _GUI)
    {
      List<GUIListItem> _Items = new List<GUIListItem>();

      if (_List.SelectedListItemIndex != 0)
      {
        _Items.Add(new GUIListItem("Move Up"));
        if (_List.Count > 1)
        {
          _Items.Add(new GUIListItem("Move to Top"));
        }
      }

      if (_List.SelectedListItemIndex != (_List.Count - 1))
      {
        _Items.Add(new GUIListItem("Move Down"));
        if (_List.Count > 1)
        {
          _Items.Add(new GUIListItem("Move to Bottom"));
        }
      }

      _Items.Add(new GUIListItem("Delete Job"));

      if (_List.ListItems[_List.SelectedListItemIndex].Label2 == "Paused")
      {
        _Items.Add(new GUIListItem("Resume Job"));
      }
      else
      {
        _Items.Add(new GUIListItem("Pause Job"));
      }

      _Items.Add(new GUIListItem("Change Category"));

      _Items.Add(new GUIListItem("Change Priority"));

      GUIListItem _Option = MP.Menu(_Items, "Job Options");
      if (_Option != null)
      {
        switch (_Option.Label)
        {
          case "Move Up":
            SendURL(CreateURL("api?mode=switch&value=" + _List.ListItems[_List.SelectedListItemIndex].Path + "&value2=" + _List.ListItems[_List.SelectedListItemIndex - 1].Path, String.Empty, false));
            break;
          case "Move Down":
            SendURL(CreateURL("api?mode=switch&value=" + _List.ListItems[_List.SelectedListItemIndex].Path + "&value2=" + _List.ListItems[_List.SelectedListItemIndex + 1].Path, String.Empty, false));
            break;
          case "Move to Top":
            SendURL(CreateURL("api?mode=switch&value=" + _List.ListItems[_List.SelectedListItemIndex].Path + "&value2=" + _List.ListItems[0].Path, String.Empty, false));
            break;
          case "Move to Bottom":
            SendURL(CreateURL("api?mode=switch&value=" + _List.ListItems[_List.SelectedListItemIndex].Path + "&value2=" + _List.ListItems[_List.Count - 1].Path, String.Empty, false));
            break;
          case "Delete Job":
            SendURL(CreateURL("api?mode=queue&name=delete&value=" + _List.ListItems[_List.SelectedListItemIndex].Path, String.Empty, false));
            break;
          case "Pause Job":
            SendURL(CreateURL("api?mode=queue&name=pause&value=" + _List.ListItems[_List.SelectedListItemIndex].Path, String.Empty, false));
            break;
          case "Resume Job":
            SendURL(CreateURL("api?mode=queue&name=resume&value=" + _List.ListItems[_List.SelectedListItemIndex].Path, String.Empty, false));
            break;
          case "Change Category":
            SendURL(CreateURL("api?mode=change_cat&value=" + _List.ListItems[_List.SelectedListItemIndex].Path + "&value2=" + SelectCategory(), String.Empty, false));
            break;
          case "Change Priority":
            SendURL(CreateURL("api?mode=queue&name=priority&value=" + _List.ListItems[_List.SelectedListItemIndex].Path + "&value2=" + SelectPriority(), String.Empty, false));
            break;
        }
        Queue(_List, _GUI, true);
      }
    }
コード例 #18
0
    /// <summary>
    /// Page gets loaded
    /// </summary>
    protected override void OnPageLoad()
    {
      //Stopwatch bClock = Stopwatch.StartNew();

      //Log.Debug("TvMiniGuide: onpageload");
      // following line should stay. Problems with OSD not
      // appearing are already fixed elsewhere
      //GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.MiniEPG);
      AllocResources();
      ResetAllControls(); // make sure the controls are positioned relevant to the OSD Y offset            

      lstChannels = getChannelList();

      if (lstChannelsWithStateIcons != null)
      {
        lstChannelsWithStateIcons.Visible = false;
      }
      lstChannels.Visible = true;

      spinGroup.CycleItems = true;

      FillChannelList();
      FillGroupList();
      base.OnPageLoad();

      //Log.Debug("TvMiniGuide: onpageload took {0} msec", bClock.ElapsedMilliseconds);
    }
コード例 #19
0
        public void DoPlay(YouTubeEntry vid, bool fullscr, GUIListControl facade)
        {
            if (vid != null)
            {
            VideoInfo qa = SelectQuality(vid);
            if (qa.Quality == VideoQuality.Unknow)
                return;
            Youtube2MP.temp_player.Reset();
            Youtube2MP.temp_player.RepeatPlaylist = true;

            Youtube2MP.temp_player.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC_VIDEO;
            PlayList playlist = Youtube2MP.temp_player.GetPlaylist(PlayListType.PLAYLIST_MUSIC_VIDEO);
            playlist.Clear();
            g_Player.PlayBackStopped += new g_Player.StoppedHandler(g_Player_PlayBackStopped);
            AddItemToPlayList(vid, ref playlist, qa);

            if (facade != null)
            {
                qa.Items = new Dictionary<string, string>();
                int selected = facade.SelectedListItemIndex ;
                for (int i = selected + 1; i < facade.ListItems.Count; i++)
                {
                    AddItemToPlayList(facade.ListItems[i], ref playlist, new VideoInfo(qa));
                }
            }

            PlayListPlayer.SingletonPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_NONE;
            Youtube2MP.player.CurrentPlaylistType = PlayListType.PLAYLIST_NONE;
            Youtube2MP.temp_player.Play(0);

            if (g_Player.Playing && fullscr)
            {
                if (_setting.ShowNowPlaying)
                {
                    GUIWindowManager.ActivateWindow(29052);
                }
                else
                {
                    g_Player.ShowFullScreenWindow();
                }
            }

            if (!g_Player.Playing)
            {
                Err_message("Unable to playback the item ! ");
            }
            }
        }
コード例 #20
0
ファイル: MiniGuide.cs プロジェクト: dot-i/ARGUS-TV-Clients
 private void InitializeChannelListControl()
 {
     if (_channelsListControlWithStateIcons != null
         && TvHome.ShowChannelStateIcons)
     {
         _channelsListControl = _channelsListControlWithStateIcons;
         _channelsListControlNoStateIcons.Visible = false;
         _showStateIcons = true;
     }
     else
     {
         _channelsListControl = _channelsListControlNoStateIcons;
         if (_channelsListControlWithStateIcons != null)
         {
             _channelsListControlWithStateIcons.Visible = false;
         }
         _showStateIcons = false;
     }
     _channelsListControl.Visible = true;
 }
コード例 #21
0
 public NavigationObject(GUIListControl control, string tit, int pos, View curview)
 {
     Items = new List<GUIListItem>();
       GetItems(control, tit, pos, curview);
 }