当前位置: 首页>>代码示例>>C#>>正文


C# VirtualDirectory.GetDirectoryExt方法代码示例

本文整理汇总了C#中MediaPortal.Util.VirtualDirectory.GetDirectoryExt方法的典型用法代码示例。如果您正苦于以下问题:C# VirtualDirectory.GetDirectoryExt方法的具体用法?C# VirtualDirectory.GetDirectoryExt怎么用?C# VirtualDirectory.GetDirectoryExt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaPortal.Util.VirtualDirectory的用法示例。


在下文中一共展示了VirtualDirectory.GetDirectoryExt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnShowSavedPlaylists

        protected void OnShowSavedPlaylists(string _directory)
        {
            // Set TVSeries Playlist Extension
            VirtualDirectory _virtualDirectory = new VirtualDirectory();
            _virtualDirectory.AddExtension(".tvsplaylist");

            // Get All Playlists found in Directory
            List<GUIListItem> itemlist = _virtualDirectory.GetDirectoryExt(_directory);
            if (_directory == DBOption.GetOptions(DBOption.cPlaylistPath))
                itemlist.RemoveAt(0);

            // If no playlists found, show a Message to user and then exit
            if (itemlist.Count == 0)
            {
                GUIDialogOK dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
                dlgOK.SetHeading(983);
                dlgOK.SetLine(1, Translation.NoPlaylistsFound);
                dlgOK.SetLine(2, _directory);
                dlgOK.DoModal(GUIWindowManager.ActiveWindow);
                return;
            }

            // Create Playist Menu Dialog
            GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
            if (dlg == null)
                return;
            dlg.Reset();
            dlg.SetHeading(983); // Saved Playlists

            // Add all playlists found to Menu for selection
            foreach (GUIListItem item in itemlist)
            {
                MediaPortal.Util.Utils.SetDefaultIcons(item);
                dlg.Add(item);
            }

            // Show Plaulist Menu Dialog
            dlg.DoModal(GetID);

            // Nothing was selected e.g. BACK
            if (dlg.SelectedLabel == -1)
                return;

            GUIListItem selectItem = itemlist[dlg.SelectedLabel];

            // If Item selected was a Folder, re-curse to show contents
            if (selectItem.IsFolder)
            {
                OnShowSavedPlaylists(selectItem.Path);
                return;
            }

            // Load the Selected Playlist
            GUIWaitCursor.Show();
            LoadPlayList(selectItem.Path);
            GUIWaitCursor.Hide();
        }
开发者ID:MichelZ,项目名称:MP-TVSeries,代码行数:57,代码来源:TVSeriesPlugin.cs

示例2: OnShowSavedPlaylists

    protected void OnShowSavedPlaylists(string _directory)
    {
      VirtualDirectory _virtualDirectory = new VirtualDirectory();
      _virtualDirectory.AddExtension(".m3u");
      _virtualDirectory.AddExtension(".pls");
      _virtualDirectory.AddExtension(".b4s");
      _virtualDirectory.AddExtension(".wpl");

      List<GUIListItem> itemlist = _virtualDirectory.GetDirectoryExt(_directory);
      if (_directory == m_strPlayListPath)
      {
        itemlist.RemoveAt(0);
      }

      GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
      if (dlg == null)
      {
        return;
      }
      dlg.Reset();
      dlg.SetHeading(983); // Saved Playlists

      foreach (GUIListItem item in itemlist)
      {
        Util.Utils.SetDefaultIcons(item);
        dlg.Add(item);
      }

      dlg.DoModal(GetID);

      if (dlg.SelectedLabel == -1)
      {
        return;
      }

      GUIListItem selectItem = itemlist[dlg.SelectedLabel];
      if (selectItem.IsFolder)
      {
        OnShowSavedPlaylists(selectItem.Path);
        return;
      }

      GUIWaitCursor.Show();
      LoadPlayList(selectItem.Path);
      GUIWaitCursor.Hide();
    }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:46,代码来源:GUIVideoBaseWindow.cs

示例3: OnShowSavedPlaylists

        /// <summary>
        /// Show saved playlists
        /// </summary>
        /// <param name="_directory"></param>
        protected void OnShowSavedPlaylists(string _directory)
        {
            VirtualDirectory _virtualDirectory = new VirtualDirectory();
              _virtualDirectory.AddExtension(".mvplaylist");

              List<GUIListItem> itemlist = _virtualDirectory.GetDirectoryExt(_directory);
              string playListPath = string.Empty;

              if (!string.IsNullOrEmpty(mvCentralCore.Settings.PlayListFolder.Trim()))
            playListPath = mvCentralCore.Settings.PlayListFolder;
              else
              {
            using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings())
            {
              playListPath = xmlreader.GetValueAsString("movies", "playlists", string.Empty);
              playListPath = MediaPortal.Util.Utils.RemoveTrailingSlash(playListPath);
            }
              }

              if (_directory == playListPath)
            itemlist.RemoveAt(0);

              // If no playlists found, show a Message to user and then exit
              if (itemlist.Count == 0)
              {
            GUIDialogOK dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
            dlgOK.SetHeading(983);
            dlgOK.SetLine(1, Localization.NoPlaylistsFound);
            dlgOK.SetLine(2, _directory);
            dlgOK.DoModal(GUIWindowManager.ActiveWindow);
            return;
              }

              GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
              if (dlg == null)
            return;
              dlg.Reset();
              dlg.SetHeading(983); // Saved Playlists

              foreach (GUIListItem item in itemlist)
              {
            MediaPortal.Util.Utils.SetDefaultIcons(item);
            dlg.Add(item);
              }

              dlg.DoModal(GetID);

              if (dlg.SelectedLabel == -1)
            return;

              GUIListItem selectItem = itemlist[dlg.SelectedLabel];
              if (selectItem.IsFolder)
              {
            OnShowSavedPlaylists(selectItem.Path);
            return;
              }

              GUIWaitCursor.Show();
              LoadPlayList(selectItem.Path);
              GUIWaitCursor.Hide();
        }
开发者ID:andrewjswan,项目名称:mvcentral,代码行数:65,代码来源:GUImvPlaylist.cs


注:本文中的MediaPortal.Util.VirtualDirectory.GetDirectoryExt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。