Esempio n. 1
0
        private void renamePodcast_Click(object sender, RoutedEventArgs e)
        {
            VodCast vodcast = podcastList.SelectedItem as VodCast;

            if (vodcast != null)
            {
                var form = new RenameForm(vodcast.Name);
                form.Owner = this;
                var result = form.ShowDialog();
                if (result == true)
                {
                    vodcast.Name = form.tbxName.Text;
                    Kernel.Instance.ItemRepository.SaveItem(vodcast);

                    RefreshPodcasts();

                    foreach (VodCast item in podcastList.Items)
                    {
                        if (item.Name == vodcast.Name)
                        {
                            podcastList.SelectedItem = item;
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void podcastList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            VodCast vodcast = podcastList.SelectedItem as VodCast;

            if (vodcast != null)
            {
                podcastDetails(true);
                podcastUrl.Text         = vodcast.Url;
                podcastName.Content     = vodcast.Name;
                podcastDescription.Text = vodcast.Overview;
            }
        }
Esempio n. 3
0
        public void TestPodcastInitialization()
        {
            MockMediaLocation location = new MockMediaLocation("test.vodcast");

            location.Contents  = "url : http://somewhere.com\n";
            location.Contents += "download_policy : FirstPlay\n";
            location.Contents += "files_to_retain : 10\n";

            VodCast vodcast = new VodCast();

            vodcast.Assign(location, null, Guid.NewGuid());

            Assert.AreEqual(vodcast.Url, "http://somewhere.com");
            Assert.AreEqual(vodcast.DownloadPolicy, DownloadPolicy.FirstPlay);
            Assert.AreEqual(vodcast.FilesToRetain, 10);
        }
Esempio n. 4
0
        private void removePodcast_Click(object sender, RoutedEventArgs e)
        {
            VodCast vodcast = podcastList.SelectedItem as VodCast;

            if (vodcast != null)
            {
                var message = "Remove \"" + vodcast.Name + "\"?";
                if (
                    MessageBox.Show(message, "Remove folder", MessageBoxButton.YesNoCancel) == MessageBoxResult.Yes)
                {
                    File.Delete(vodcast.Path);
                    vodcast.Parent.ValidateChildren();
                    podcastDetails(false);
                    RefreshPodcasts();
                }
            }
        }
Esempio n. 5
0
        public void TestPodcastFetching()
        {
            var backup = Kernel.Instance.MediaLocationFactory;

            MockMediaLocation location = new MockMediaLocation("test.vodcast");

            location.Contents = "url : http://www.abc.net.au/atthemovies/vodcast_wmv.xml";

            // our kernel needs to know how to retrieve our location.
            Kernel.Instance.MediaLocationFactory = new MockMediaLocationFactory(location);

            VodCast vodcast = new VodCast();

            vodcast.Assign(location, null, Guid.NewGuid());

            Assert.IsTrue(vodcast.Children.Count > 0);

            Kernel.Instance.MediaLocationFactory = backup;
        }
Esempio n. 6
0
        public void TestTEDPodcastFetching()
        {
            var backup = Kernel.Instance.MediaLocationFactory;

            MockMediaLocation location = new MockMediaLocation("test.vodcast");

            location.Contents = "url : http://feeds.feedburner.com/TedtalksHD?format=xml";

            // our kernel needs to know how to retrieve our location.
            Kernel.Instance.MediaLocationFactory = new MockMediaLocationFactory(location);

            VodCast vodcast = new VodCast();

            vodcast.Assign(location, null, Guid.NewGuid());

            Assert.IsTrue(vodcast.Children.Count > 0);

            Kernel.Instance.MediaLocationFactory = backup;
        }