Exemplo n.º 1
0
 private void GetNowPlaying(string hmoServer, string mediaAccessKey, Application app)
 {
     _connection = new TivoConnection(hmoServer, mediaAccessKey);
     _connection.Open();
     _query = _connection.CreateContainerQuery("/NowPlaying").Recurse();
     _query.BeginExecute(QueryUsage, app);
     //_connection.BeginQueryContainer("/NowPlaying", true, QueryUsage, app);
 }
Exemplo n.º 2
0
        public void QueryUsage(IAsyncResult result)
        {
            Application app = (Application)result.AsyncState;

            TivoContainer container = _query.EndExecute(result);

            _containers.Add(container);

            if (container.ItemStart + container.ItemCount < container.TotalItems)
            {
                _query = _query.Skip(container.ItemStart + container.ItemCount);
                _query.BeginExecute(QueryUsage, app);
            }
            else
            {
                _connection.Dispose();
                CategoryPieView pieView      = new CategoryPieView(DiskUsageCalculator.Calculate(_containers, _tivoName));
                View            previousView = app.Root.Children[0];
                app.Root.Children.RemoveAt(0);
                app.Root.Children.Add(pieView);
                previousView.Dispose();
            }
        }