public void can_download_ansi_feed()
        {
            const string expected = "NHibernate.Profiler-Build-";

            var ws = new SimpleWebSource("http://builds.hibernatingrhinos.com/latest/nhprof");
            var str = ws.GetUpdatesFeed();

            Assert.AreEqual(expected, str.Substring(0, expected.Length));
        }
Beispiel #2
0
        private void btnCheckForUpdatesCustom_Click(object sender, EventArgs e)
        {
            string feedUrl = InputBox("Please enter a Url for a valid NauXml feed", "Feed Url required", "");

            if (string.IsNullOrEmpty(feedUrl))
                return;

            IUpdateSource source = UpdateManager.Instance.UpdateSource;
            if (source is SimpleWebSource)
            {
                // All we need to do is set the feed url and we are all set, no need to create new objects etc
                ((SimpleWebSource)source).FeedUrl = feedUrl;
                CheckForUpdates(source);
            }
            else
            {
                // No idea what we had there, so we create a new feed source and pass it along - note the
                // source for retreiving the actual updates will keep intact, and will be used when preparing
                // the updates
                source = new SimpleWebSource(feedUrl);
                CheckForUpdates(source);
            }
        }
Beispiel #3
0
        private AppUpdate.Sources.IUpdateSource PrepareUpdateSource()
        {
            // Normally this would be a web based source.
            // But for the demo app, we prepare an in-memory source.
            var source = new SimpleWebSource("http://service2.jinlook.com/hello12306/update.xml");
                //new AppUpdate.Sources.MemorySource(File.ReadAllText("SampleAppUpdateFeed.xml"));
            //source.AddTempFile(new Uri("http://SomeSite.com/Files/NewVersion.txt"), "NewVersion.txt");

            return source;
        }