Skip to content

Commit

Permalink
RC1/Beta21 release
Browse files Browse the repository at this point in the history
  • Loading branch information
briandunnington committed Sep 14, 2009
1 parent adf22a9 commit 8044994
Show file tree
Hide file tree
Showing 73 changed files with 5,211 additions and 3,937 deletions.
Binary file modified Growl Connectors/AIR/bin/GrowlAIRConnector.swf
Binary file not shown.
Binary file modified Growl Connectors/NET/libraries/Growl.Connector.dll
Binary file not shown.
Binary file modified Growl Connectors/NET/libraries/Growl.CoreLibrary.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Net.Framework.3.5"
{
"Name" = "8:.NET Framework 3.5"
"ProductCode" = "8:Microsoft.Net.Framework.3.5"
}
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1"
{
"Name" = "8:Windows Installer 3.1"
"ProductCode" = "8:Microsoft.Windows.Installer.3.1"
}
}
}
}
"Release"
Expand All @@ -104,6 +117,19 @@
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Net.Framework.3.5"
{
"Name" = "8:.NET Framework 3.5"
"ProductCode" = "8:Microsoft.Net.Framework.3.5"
}
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1"
{
"Name" = "8:Windows Installer 3.1"
"ProductCode" = "8:Microsoft.Windows.Installer.3.1"
}
}
}
}
}
Expand Down Expand Up @@ -252,14 +278,14 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Feed Monitor"
"ProductCode" = "8:{E9DDAEC7-E0DA-4276-8AF9-DC7AA949EA77}"
"PackageCode" = "8:{55F42076-6BAF-4B26-9D91-1F3DB212F9E1}"
"ProductCode" = "8:{112838BB-CDED-4071-AB0D-865F82874302}"
"PackageCode" = "8:{B67AFFBF-0CCE-41B9-88E8-74A41DE9618C}"
"UpgradeCode" = "8:{E8D784D8-949E-4CC9-BA80-A316D25574D7}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.1"
"ProductVersion" = "8:1.0.2"
"Manufacturer" = "8:element code project"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="_source\Feed.cs" />
<Compile Include="_source\FeedInfo.cs" />
<Compile Include="_source\FeedItem.cs" />
<Compile Include="_source\GenericFeedParser.cs" />
<Compile Include="_source\Rss10FeedFormatter.cs" />
<Compile Include="_source\SettingsPersister.cs" />
<Compile Include="_source\User32DLL.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public void RemoveFeed(Feed feed)
feed.FeedRetrieved -= feed_FeedRetrieved;
feed.FeedUpdated -= feed_FeedUpdated;
this.feeds.Remove(feed);
feed.Dispose();
feed = null;
}

Expand Down Expand Up @@ -175,16 +176,16 @@ void feed_FeedUpdated(object sender, FeedUpdatedEventArgs e)
{
if (e != null && e.NewItems != null)
{
foreach (SyndicationItem item in e.NewItems)
foreach (FeedItem item in e.NewItems)
{
//this.notifyIcon.ShowBalloonTip(1000, item.SourceFeed.Title.Text, item.Title.Text, ToolTipIcon.Info);

Notification n = new Notification(this.app.Name, this.ntNewFeedItem.Name, item.Id, item.SourceFeed.Title.Text, item.Title.Text);
Notification n = new Notification(this.app.Name, this.ntNewFeedItem.Name, String.Empty, item.SourceFeed.Title, item.Title);

CallbackContext c = null;
if (item.Links != null && item.Links.Count > 0)
if (!String.IsNullOrEmpty(item.Link))
{
c = new CallbackContext(item.Links[0].Uri.ToString());
c = new CallbackContext(item.Link);
}

this.growl.Notify(n, c);
Expand Down Expand Up @@ -216,6 +217,7 @@ void notifyIcon_DoubleClick(object sender, EventArgs e)
private void ShowForm()
{
this.mainForm.Show();
this.mainForm.Activate();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ private void labelAdd_Click(object sender, EventArgs e)
{
this.mainComponent.AddFeed(this.textBoxFeedUrl.Text, Properties.Settings.Default.DefaultInterval);
this.panel1.Hide();
this.textBoxFeedUrl.Text = String.Empty;
this.Show();
this.Refresh();
}
Expand Down
108 changes: 69 additions & 39 deletions Growl Extras/Feed Monitor/GrowlExtras.FeedMonitor/_source/Feed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Syndication;
using System.Xml;
using System.Net;

namespace GrowlExtras.FeedMonitor
{
public class Feed
public class Feed : IDisposable
{
public event EventHandler<FeedRetrievedEventArgs> FeedRetrieved;
public event EventHandler<FeedUpdatedEventArgs> FeedUpdated;
Expand Down Expand Up @@ -92,44 +91,54 @@ public void CheckForUpdates()
{
if (!this.webclient.IsBusy)
{
this.webclient.Headers.Add(System.Net.HttpRequestHeader.UserAgent, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
this.webclient.OpenReadAsync(this.url);
this.lastCheckForUpdates = DateTime.Now;
}
}

void webclient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
WebClient wc = (WebClient)sender;

// process the feed
if (e.Error == null && e.Result != null)
{
using (XmlReader reader = XmlReader.Create(e.Result))
/* THIS IS JUST FOR TESTING
List<byte> chars = new List<byte>();
System.IO.StreamReader r = new System.IO.StreamReader(e.Result);
using (r)
{
try
{
SyndicationFeed feed = null;
try
{
feed = SyndicationFeed.Load(reader);
}
catch
{
// the loader couldn't load the feed, but it might be RSS 1.0, so try that
Rss10FeedFormatter formatter = new Rss10FeedFormatter();
if (formatter.CanRead(reader))
{
formatter.ReadFrom(reader);
feed = formatter.Feed;
}
}
OnFeedRetrieved(feed);
}
catch (Exception ex)
while (r.Peek() > 0)
{
// the loader couldn't load the feed
FeedErrorEventArgs args = new FeedErrorEventArgs(new FeedException(_parseErrorMessage, ex));
OnFeedError(args);
chars.Add((byte) r.Read());
}
}
byte[] bytes = chars.ToArray();
string s = System.Text.Encoding.UTF8.GetString(bytes);
Console.WriteLine(s);
* */

FeedInfo info = null;
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
using (XmlReader reader = XmlReader.Create(e.Result, settings))
{
GenericFeedParser parser = new GenericFeedParser();
info = parser.Parse(reader);
}

if (info != null)
{
info.Url = this.Url;
OnFeedRetrieved(info);
}
else
{
// the loader couldn't load the feed
FeedErrorEventArgs args = new FeedErrorEventArgs(new FeedException(_parseErrorMessage));
OnFeedError(args);
}
}
else
{
Expand All @@ -154,9 +163,9 @@ void webclient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
/// <summary>
/// Internal method used to raise the feed event
/// </summary>
protected void OnFeedRetrieved(SyndicationFeed feed)
protected void OnFeedRetrieved(FeedInfo feed)
{
this.name = feed.Title.Text;
this.name = feed.Title;
DateTimeOffset mostRecentItem = this.feedLastUpdated;
if (mostRecentItem == DateTimeOffset.MaxValue) mostRecentItem = DateTimeOffset.MinValue;

Expand All @@ -170,11 +179,11 @@ protected void OnFeedRetrieved(SyndicationFeed feed)

if (FeedUpdated != null)
{
List<SyndicationItem> newitems = new List<SyndicationItem>();
foreach (SyndicationItem item in feed.Items)
List<FeedItem> newitems = new List<FeedItem>();
foreach (FeedItem item in feed.Items)
{
DateTimeOffset itemDate = item.LastUpdatedTime;
if (itemDate == DateTimeOffset.MinValue) itemDate = item.PublishDate;
DateTimeOffset itemDate = item.PubDate;
//if (itemDate == DateTimeOffset.MinValue) itemDate = item.PublishDate;

System.Diagnostics.Debug.WriteLine(String.Format("Item Published at: {0} - (last update at: {1})", itemDate, this.feedLastUpdated));

Expand All @@ -184,7 +193,6 @@ protected void OnFeedRetrieved(SyndicationFeed feed)
if (itemDate > this.feedLastUpdated)
{
newitems.Add(item);
//item.SourceFeed.Title = feed.Title; // override this value since some feed items specify a different source (and we dont want that)
item.SourceFeed = feed;
}
}
Expand All @@ -203,6 +211,28 @@ protected void OnFeedError(FeedErrorEventArgs args)
if (FeedError != null)
FeedError(this, args);
}

#region IDisposable Members

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

private void Dispose(bool disposing)
{
if (disposing)
{
if (this.timer != null)
this.timer.Dispose();

if (this.webclient != null)
this.webclient.Dispose();
}
}

#endregion
}

public class FeedException : Exception
Expand All @@ -226,14 +256,14 @@ public FeedException(string message, Exception innerException)

public class FeedUpdatedEventArgs : EventArgs
{
private List<SyndicationItem> newitems;
private List<FeedItem> newitems;

public FeedUpdatedEventArgs(List<SyndicationItem> newitems)
public FeedUpdatedEventArgs(List<FeedItem> newitems)
{
this.newitems = newitems;
}

public List<SyndicationItem> NewItems
public List<FeedItem> NewItems
{
get { return this.newitems; }
}
Expand All @@ -242,14 +272,14 @@ public List<SyndicationItem> NewItems

public class FeedRetrievedEventArgs : EventArgs
{
private SyndicationFeed feed;
private FeedInfo feed;

public FeedRetrievedEventArgs(SyndicationFeed feed)
public FeedRetrievedEventArgs(FeedInfo feed)
{
this.feed = feed;
}

public SyndicationFeed Feed
public FeedInfo Feed
{
get { return this.feed; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GrowlExtras.FeedMonitor
{
public class FeedInfo
{
string title;
string url;
List<FeedItem> items;

public string Title
{
get
{
return this.title;
}
set
{
this.title = value;
}
}

public string Url
{
get
{
return this.url;
}
set
{
this.url = value;
}
}

public List<FeedItem> Items
{
get
{
return this.items;
}
set
{
this.items = value;
}
}
}
}
Loading

0 comments on commit 8044994

Please sign in to comment.