Skip to content

Commit

Permalink
Feed Monitor updates;Winamp Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
briandunnington committed Nov 23, 2009
1 parent 193620d commit f0b4e39
Show file tree
Hide file tree
Showing 19 changed files with 1,415 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Feed Monitor"
"ProductCode" = "8:{D99BA834-77E8-4EF6-A7A2-EBEE443D008D}"
"PackageCode" = "8:{EE845C0A-695D-4FC6-B6AF-2E4DD4718025}"
"ProductCode" = "8:{DC4C593B-CD43-4367-8DB0-0140911B87E3}"
"PackageCode" = "8:{A990284C-9B85-4E9B-8177-4585D19C9224}"
"UpgradeCode" = "8:{E8D784D8-949E-4CC9-BA80-A316D25574D7}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.7"
"ProductVersion" = "8:1.0.8"
"Manufacturer" = "8:element code project"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down Expand Up @@ -811,6 +811,34 @@
}
"ProjectOutput"
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_175184ED0EAB4826BC56616B18977203"
{
"SourcePath" = "8:"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_194ABD0627A144529BAE11330BC2D515"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
"ProjectOutputGroupRegister" = "3:1"
"OutputConfiguration" = "8:"
"OutputGroupCanonicalName" = "8:ContentFiles"
"OutputProjectGuid" = "8:{40C8E85D-CED7-4CB5-8584-EB7E27C516FD}"
"ShowKeyOutput" = "11:TRUE"
"ExcludeFilters"
{
}
}
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_C67A5587097A4441ADB422A23AA85F88"
{
"SourcePath" = "8:..\\GrowlExtras.FeedMonitor\\obj\\Release\\GrowlExtras.FeedMonitor.exe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
<None Include="app.config" />
<None Include="Resources\feed.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="formats.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.7.0")]
[assembly: AssemblyFileVersion("1.0.8.0")]
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Xml;

namespace GrowlExtras.FeedMonitor
{
Expand All @@ -10,24 +12,45 @@ namespace GrowlExtras.FeedMonitor
/// </summary>
public class Rfc822DateTime
{
//============================================================
// Private members
//============================================================
#region Private Members
/// <summary>
/// Private member to hold array of formats that RFC 822 date-time representations conform to.
/// </summary>
private static string[] formats = new string[0];

/// <summary>
/// Private member to hold the DateTime format string for representing a DateTime in the RFC 822 format.
/// </summary>
private const string format = "ddd, dd MMM yyyy HH:mm:ss K";
#endregion

//============================================================
// Public Properties
//============================================================
#region Rfc822DateTimeFormat
private static Dictionary<string, string> timezoneOffsets = null;

static Rfc822DateTime()
{
XmlDocument xml = new XmlDocument();
xml.Load("formats.xml");

List<string> formatList = new List<string>();
XmlNodeList formatNodes = xml.SelectNodes("/datetimeparser/formats/format");
foreach (XmlNode formatNode in formatNodes)
{
formatList.Add(formatNode.InnerText);
}
// Fall back patterns
formatList.Add(DateTimeFormatInfo.InvariantInfo.UniversalSortableDateTimePattern);
formatList.Add(DateTimeFormatInfo.InvariantInfo.SortableDateTimePattern);
formats = formatList.ToArray();

timezoneOffsets = new Dictionary<string, string>();
XmlNodeList timezoneNodes = xml.SelectNodes("/datetimeparser/timezones/timezone");
foreach (XmlNode timezoneNode in timezoneNodes)
{
string abbr = timezoneNode.Attributes["abbr"].Value;
string val = timezoneNode.InnerText;
timezoneOffsets.Add(abbr, val);
}
}


/// <summary>
/// Gets the custom format specifier that may be used to represent a <see cref="DateTime"/> in the RFC 822 format.
/// </summary>
Expand Down Expand Up @@ -55,9 +78,7 @@ public static string Rfc822DateTimeFormat
return format;
}
}
#endregion

#region Rfc822DateTimePatterns
/// <summary>
/// Gets an array of the expected formats for RFC 822 date-time string representations.
/// </summary>
Expand All @@ -74,69 +95,10 @@ public static string[] Rfc822DateTimePatterns
{
get
{
if (formats.Length > 0)
{
return formats;
}
else
{
formats = new string[35];

// two-digit day, four-digit year patterns
formats[0] = "ddd',' dd MMM yyyy HH':'mm':'ss'.'fffffff zzzz";
formats[1] = "ddd',' dd MMM yyyy HH':'mm':'ss'.'ffffff zzzz";
formats[2] = "ddd',' dd MMM yyyy HH':'mm':'ss'.'fffff zzzz";
formats[3] = "ddd',' dd MMM yyyy HH':'mm':'ss'.'ffff zzzz";
formats[4] = "ddd',' dd MMM yyyy HH':'mm':'ss'.'fff zzzz";
formats[5] = "ddd',' dd MMM yyyy HH':'mm':'ss'.'ff zzzz";
formats[6] = "ddd',' dd MMM yyyy HH':'mm':'ss'.'f zzzz";
formats[7] = "ddd',' dd MMM yyyy HH':'mm':'ss zzzz";

// two-digit day, two-digit year patterns
formats[8] = "ddd',' dd MMM yy HH':'mm':'ss'.'fffffff zzzz";
formats[9] = "ddd',' dd MMM yy HH':'mm':'ss'.'ffffff zzzz";
formats[10] = "ddd',' dd MMM yy HH':'mm':'ss'.'fffff zzzz";
formats[11] = "ddd',' dd MMM yy HH':'mm':'ss'.'ffff zzzz";
formats[12] = "ddd',' dd MMM yy HH':'mm':'ss'.'fff zzzz";
formats[13] = "ddd',' dd MMM yy HH':'mm':'ss'.'ff zzzz";
formats[14] = "ddd',' dd MMM yy HH':'mm':'ss'.'f zzzz";
formats[15] = "ddd',' dd MMM yy HH':'mm':'ss zzzz";

// one-digit day, four-digit year patterns
formats[16] = "ddd',' d MMM yyyy HH':'mm':'ss'.'fffffff zzzz";
formats[17] = "ddd',' d MMM yyyy HH':'mm':'ss'.'ffffff zzzz";
formats[18] = "ddd',' d MMM yyyy HH':'mm':'ss'.'fffff zzzz";
formats[19] = "ddd',' d MMM yyyy HH':'mm':'ss'.'ffff zzzz";
formats[20] = "ddd',' d MMM yyyy HH':'mm':'ss'.'fff zzzz";
formats[21] = "ddd',' d MMM yyyy HH':'mm':'ss'.'ff zzzz";
formats[22] = "ddd',' d MMM yyyy HH':'mm':'ss'.'f zzzz";
formats[23] = "ddd',' d MMM yyyy HH':'mm':'ss zzzz";

// two-digit day, two-digit year patterns
formats[24] = "ddd',' d MMM yy HH':'mm':'ss'.'fffffff zzzz";
formats[25] = "ddd',' d MMM yy HH':'mm':'ss'.'ffffff zzzz";
formats[26] = "ddd',' d MMM yy HH':'mm':'ss'.'fffff zzzz";
formats[27] = "ddd',' d MMM yy HH':'mm':'ss'.'ffff zzzz";
formats[28] = "ddd',' d MMM yy HH':'mm':'ss'.'fff zzzz";
formats[29] = "ddd',' d MMM yy HH':'mm':'ss'.'ff zzzz";
formats[30] = "ddd',' d MMM yy HH':'mm':'ss'.'f zzzz";
formats[31] = "ddd',' d MMM yy HH':'mm':'ss zzzz";

// Fall back patterns
formats[32] = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; // RoundtripDateTimePattern
formats[33] = DateTimeFormatInfo.InvariantInfo.UniversalSortableDateTimePattern;
formats[34] = DateTimeFormatInfo.InvariantInfo.SortableDateTimePattern;

return formats;
}
return formats;
}
}
#endregion

//============================================================
// Public Methods
//============================================================
#region Parse(string s)
/// <summary>
/// Converts the specified string representation of a date and time to its <see cref="DateTime"/> equivalent.
/// </summary>
Expand All @@ -163,9 +125,7 @@ public static DateTime Parse(string s)
throw new FormatException(String.Format(null, "{0} is not a valid RFC 822 string representation of a date and time.", s));
}
}
#endregion

#region ConvertZoneToLocalDifferential(string s)
/// <summary>
/// Converts the time zone component of an RFC 822 date and time string representation to its local differential (time zone offset).
/// </summary>
Expand All @@ -175,79 +135,21 @@ public static DateTime Parse(string s)
/// <exception cref="ArgumentNullException"><paramref name="s"/> is an empty string.</exception>
public static string ConvertZoneToLocalDifferential(string s)
{
string zoneRepresentedAsLocalDifferential = String.Empty;

string zoneRepresentedAsLocalDifferential = s;

if (s.EndsWith(" UT", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" UT") + 1)), "+00:00");
}
else if (s.EndsWith(" GMT", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" GMT") + 1)), "+00:00");
}
else if (s.EndsWith(" EST", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" EST") + 1)), "-05:00");
}
else if (s.EndsWith(" EDT", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" EDT") + 1)), "-04:00");
}
else if (s.EndsWith(" CST", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" CST") + 1)), "-06:00");
}
else if (s.EndsWith(" CDT", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" CDT") + 1)), "-05:00");
}
else if (s.EndsWith(" MST", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" MST") + 1)), "-07:00");
}
else if (s.EndsWith(" MDT", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" MDT") + 1)), "-06:00");
}
else if (s.EndsWith(" PST", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" PST") + 1)), "-08:00");
}
else if (s.EndsWith(" PDT", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" PDT") + 1)), "-07:00");
}
else if (s.EndsWith(" Z", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" Z") + 1)), "+00:00");
}
else if (s.EndsWith(" A", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" A") + 1)), "-01:00");
}
else if (s.EndsWith(" M", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" M") + 1)), "-12:00");
}
else if (s.EndsWith(" N", StringComparison.OrdinalIgnoreCase))
foreach (KeyValuePair<string, string> item in timezoneOffsets)
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" N") + 1)), "+01:00");
}
else if (s.EndsWith(" Y", StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(" Y") + 1)), "+12:00");
}
else
{
zoneRepresentedAsLocalDifferential = s;
string ending = String.Format(" {0}", item.Key);
if (s.EndsWith(ending, StringComparison.OrdinalIgnoreCase))
{
zoneRepresentedAsLocalDifferential = String.Concat(s.Substring(0, (s.LastIndexOf(ending) + 1)), item.Value);
break;
}
}

return zoneRepresentedAsLocalDifferential;
}
#endregion

#region ToString(DateTime utcDateTime)
/// <summary>
/// Converts the value of the specified <see cref="DateTime"/> object to its equivalent string representation.
/// </summary>
Expand All @@ -263,9 +165,7 @@ public static string ToString(DateTime utcDateTime)

return utcDateTime.ToString(Rfc822DateTime.Rfc822DateTimeFormat, DateTimeFormatInfo.InvariantInfo);
}
#endregion

#region TryParse(string s, out DateTime result)
/// <summary>
/// Converts the specified string representation of a date and time to its <see cref="DateTime"/> equivalent.
/// </summary>
Expand Down Expand Up @@ -302,6 +202,5 @@ public static bool TryParse(string s, out DateTime result)

return wasConverted;
}
#endregion
}
}
67 changes: 67 additions & 0 deletions Growl Extras/Feed Monitor/GrowlExtras.FeedMonitor/formats.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8" ?>
<datetimeparser>
<formats>
<!-- two-digit day, four-digit year patterns -->
<format>ddd',' dd MMM yyyy HH':'mm':'ss'.'fffffff zzzz</format>
<format>ddd',' dd MMM yyyy HH':'mm':'ss'.'ffffff zzzz</format>
<format>ddd',' dd MMM yyyy HH':'mm':'ss'.'fffff zzzz</format>
<format>ddd',' dd MMM yyyy HH':'mm':'ss'.'ffff zzzz</format>
<format>ddd',' dd MMM yyyy HH':'mm':'ss'.'fff zzzz</format>
<format>ddd',' dd MMM yyyy HH':'mm':'ss'.'ff zzzz</format>
<format>ddd',' dd MMM yyyy HH':'mm':'ss'.'f zzzz</format>
<format>ddd',' dd MMM yyyy HH':'mm':'ss zzzz</format>

<!-- two-digit day, two-digit year patterns -->
<format>ddd',' dd MMM yy HH':'mm':'ss'.'fffffff zzzz</format>
<format>ddd',' dd MMM yy HH':'mm':'ss'.'ffffff zzzz</format>
<format>ddd',' dd MMM yy HH':'mm':'ss'.'fffff zzzz</format>
<format>ddd',' dd MMM yy HH':'mm':'ss'.'ffff zzzz</format>
<format>ddd',' dd MMM yy HH':'mm':'ss'.'fff zzzz</format>
<format>ddd',' dd MMM yy HH':'mm':'ss'.'ff zzzz</format>
<format>ddd',' dd MMM yy HH':'mm':'ss'.'f zzzz</format>
<format>ddd',' dd MMM yy HH':'mm':'ss zzzz</format>

<!-- one-digit day, four-digit year patterns -->
<format>ddd',' d MMM yyyy HH':'mm':'ss'.'fffffff zzzz</format>
<format>ddd',' d MMM yyyy HH':'mm':'ss'.'ffffff zzzz</format>
<format>ddd',' d MMM yyyy HH':'mm':'ss'.'fffff zzzz</format>
<format>ddd',' d MMM yyyy HH':'mm':'ss'.'ffff zzzz</format>
<format>ddd',' d MMM yyyy HH':'mm':'ss'.'fff zzzz</format>
<format>ddd',' d MMM yyyy HH':'mm':'ss'.'ff zzzz</format>
<format>ddd',' d MMM yyyy HH':'mm':'ss'.'f zzzz</format>
<format>ddd',' d MMM yyyy HH':'mm':'ss zzzz</format>

<!-- two-digit day, two-digit year patterns -->
<format>ddd',' d MMM yy HH':'mm':'ss'.'fffffff zzzz</format>
<format>ddd',' d MMM yy HH':'mm':'ss'.'ffffff zzzz</format>
<format>ddd',' d MMM yy HH':'mm':'ss'.'fffff zzzz</format>
<format>ddd',' d MMM yy HH':'mm':'ss'.'ffff zzzz</format>
<format>ddd',' d MMM yy HH':'mm':'ss'.'fff zzzz</format>
<format>ddd',' d MMM yy HH':'mm':'ss'.'ff zzzz</format>
<format>ddd',' d MMM yy HH':'mm':'ss'.'f zzzz</format>
<format>ddd',' d MMM yy HH':'mm':'ss zzzz</format>

<!-- Other -->
<format>yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK</format>
<format>yyyy'-'MM'-'dd'T'HH':'mm':'sszzz</format>
<format>yyyy'-'MM'-'dd'T'HH':'mm':'ss zzz</format>
</formats>
<timezones>
<timezone abbr="UT">+00:00</timezone>
<timezone abbr="GMT">+00:00</timezone>
<timezone abbr="GMT+00:00">+00:00</timezone>
<timezone abbr="EST">-05:00</timezone>
<timezone abbr="EDT">-04:00</timezone>
<timezone abbr="CST">-06:00</timezone>
<timezone abbr="CDT">-05:00</timezone>
<timezone abbr="MST">-07:00</timezone>
<timezone abbr="MDT">-06:00</timezone>
<timezone abbr="PST">-08:00</timezone>
<timezone abbr="PDT">-07:00</timezone>
<timezone abbr="Z">+00:00</timezone>
<timezone abbr="A">-01:00</timezone>
<timezone abbr="M">-12:00</timezone>
<timezone abbr="N">+01:00</timezone>
<timezone abbr="Y">+12:00</timezone>
</timezones>
</datetimeparser>
Binary file modified Growl Extras/Growl Display SDK/libraries/Growl.DisplayStyle.dll
Binary file not shown.
Loading

0 comments on commit f0b4e39

Please sign in to comment.