Ejemplo n.º 1
0
        public void SubscribeOpmlEmptyStringInputTest()
        {
            ArgumentException expected = null;

            try
            {
                Opml opml = FeedEngine.SubscribeOpml(string.Empty);
            }
            catch (ArgumentException ex)
            {
                expected = ex;
            }

            Assert.IsNotNull(expected);
        }
Ejemplo n.º 2
0
        public void SubscribeOpmlNullObjectInputTest()
        {
            ArgumentNullException expected = null;

            try
            {
                Opml opml = FeedEngine.SubscribeOpml((Opml)null);
            }
            catch (ArgumentNullException ex)
            {
                expected = ex;
            }

            Assert.IsNotNull(expected);
        }
Ejemplo n.º 3
0
        private void LoadOpml()
        {
            //Load opml
            int saveHeight = listFeeds.Height;

            //listFeeds.Height = saveHeight - 20;

            Cursor.Current = Cursors.WaitCursor;

            Opml opml = FeedEngine.LoadOpml(opmlPath);

            int count = opml.Items.Length;

            this.Invoke(startProgressHandler);
            // Populate TreeView
            for (int i = 0; i < count; i++)
            {
                //TreeNode node = new TreeNode(opmlItem.Title);
                //node.Tag = opmlItem.Title;
                OpmlItem opmlItem = (OpmlItem)opml.Items[i];
                currentFeed = FeedEngine.Storage.GetFeed(opmlItem.Title);
                if (currentFeed == null)
                {
                    currentFeed = FeedEngine.Receive(new Uri(opmlItem.XmlUrl));
                    FeedEngine.Storage.Add(currentFeed);
                }
                loadProgress = (int)((double)i / count * 100);
                this.Invoke(updateProgressHandler);
                this.Invoke(addNodeHandler);
            }

            FeedEngine.SubscribeOpml(opml);

            this.Invoke(endProgressHandler);
            //listFeeds.Height = saveHeight;
            Cursor.Current = Cursors.Default;
            //FeedEngine.Start();
        }
Ejemplo n.º 4
0
        private void LoadOpmlThread()
        {
            Cursor.Current = Cursors.WaitCursor;

            opml = FeedEngine.LoadOpml(opmlPath);

            int count = opml.Items.Length;

            mainForm.StartProgress();

            // Populate TreeView
            for (int i = 0; i < count; i++)
            {
                //TreeNode node = new TreeNode(opmlItem.Title);
                //node.Tag = opmlItem.Title;
                OpmlItem opmlItem = (OpmlItem)opml.Items[i];
                currentFeed = FeedEngine.Storage.GetFeed(opmlItem.Title);
                if (currentFeed == null)
                {
                    currentFeed = FeedEngine.Receive(new Uri(opmlItem.XmlUrl));
                    updateCount = currentFeed.Items.Count;
                    mainForm.UpdateTreeNode();
                    FeedEngine.Storage.Add(currentFeed);
                }
                this.loadProgress = (int)((double)i / count * 100);
                mainForm.UpdateProgress();
                mainForm.AddTreeNode();
            }

            FeedEngine.SubscribeOpml(opml);

            mainForm.EndProgress();

            Cursor.Current = Cursors.Default;

            FeedEngine.Start();
        }