Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions NetSparkle/NLog.config

This file was deleted.

2,585 changes: 0 additions & 2,585 deletions NetSparkle/NLog.xsd

This file was deleted.

19 changes: 7 additions & 12 deletions NetSparkle/NetSparkle2010.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,14 @@
<DocumentationFile>bin\x86\Release\AppLimit.NetSparkle.Net40.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>TraQ6.pfx</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\lib\NLog.dll</HintPath>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.3\lib\net40-client\log4net.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
Expand Down Expand Up @@ -169,6 +168,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SparkleFeedGenerator.cs" />
<Compile Include="UpdateDetechedEventArgs.cs" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -254,13 +254,8 @@
</ItemGroup>
<ItemGroup>
<None Include="ArtWork\software-update-available.png" />
<Content Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="TraQ6.pfx" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
Expand Down Expand Up @@ -298,4 +293,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
4 changes: 2 additions & 2 deletions NetSparkle/NetSparkleDiagnostic.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NLog;
using System.Drawing;
using System.Windows.Forms;
using log4net;

namespace AppLimit.NetSparkle
{
Expand All @@ -10,7 +10,7 @@ namespace AppLimit.NetSparkle
/// </summary>
internal class NetSparkleDiagnostic
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
private static readonly ILog logger = LogManager.GetLogger("logger");
private readonly bool _isDiagnosticWindowShown;
private readonly NetSparkleMainWindows _diagnosticWindow;

Expand Down
2 changes: 2 additions & 0 deletions NetSparkle/NetSparkleDownloadProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ private void UpdateDownloadValid()
{
if (this.IsDownloadDSAValid)
{
lblSecurityHint.Visible =false;
BackColor = Color.FromArgb(240, 240, 240);
return;
}
Size = new Size(Size.Width, 137);
Expand Down
208 changes: 208 additions & 0 deletions NetSparkle/SparkleFeedGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;

namespace AppLimit.NetSparkle
{
public class SparkleFeedGenerator
{

XmlWriter writer;
public XmlDocument Document;

#region Private Members
private string _title;
private string _link;
private string _description;
private string _language = "en";
private DateTime _pubDate;
private string _docs = "http://www.andymatuschak.org/xml-namespaces/sparkle";
#endregion

#region Public Members
///
/// Required - The name of the channel. It's how people refer to your service. If you have an HTML website that contains the same information as your RSS file, the title of your channel should be the same as the title of your website.
///
public string Title
{
get { return _title; }
set { _title = value; }
}

///
/// Required - The URL to the HTML website corresponding to the channel.
///
public string Link
{
get { return _link; }
set { _link = value; }
}

///
/// Required - Phrase or sentence describing the channel.
///
public string Description
{
get { return _description; }
set { _description = value; }
}

///
/// The language the channel is written in.
///
public string Language
{
get { return _language; }
set { _language = value; }
}


///
/// The publication date for the content in the channel. For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours. That's when the pubDate of the channel changes.
///
public DateTime PubDate
{
get { return _pubDate; }
set { _pubDate = value; }
}

///
/// A URL that points to the documentation for the format used in the RSS file.
///
public string Docs
{
get { return _docs; }
set { _docs = value; }
}


#endregion

#region Constructors


public SparkleFeedGenerator()
{
Document = new XmlDocument();
writer = Document.CreateNavigator().AppendChild();
}

#endregion

#region Methods
///
/// Writes the beginning of the RSS document
///
public void WriteStartDocument()
{
writer.WriteStartElement("rss");
writer.WriteAttributeString("version", "2.0");
writer.WriteAttributeString("sparkle", _docs);
}

///
/// Writes the end of the RSS document
///
public void WriteEndDocument()
{
writer.WriteEndElement(); //rss
writer.WriteEndDocument();
}

///
/// Closes this stream and the underlying stream
///
public void Close()
{
writer.Flush();
writer.Close();

}

///
/// Writes the beginning of a channel in the RSS document
///
public void WriteStartChannel()
{
try
{
writer.WriteStartElement("channel");

writer.WriteElementString("title", _title);
writer.WriteElementString("link", _link);
writer.WriteElementString("description", _description);

if (!String.IsNullOrEmpty(_language))
writer.WriteElementString("language", _language);

if (_pubDate != null && _pubDate != DateTime.MinValue && _pubDate != DateTime.MaxValue)
writer.WriteElementString("pubDate", _pubDate.ToString("r"));
}
catch (Exception ex)
{
throw;
}

}

///
/// Writes the end of a channel in the RSS document
///
public void WriteEndChannel()
{
writer.WriteEndElement(); //channel
}

///
/// Writes an RSS Feed Item
///
/// The title of the item.
/// The URL of the item
/// The item synopsis.
/// Email address of the author of the item.
/// Includes the item in one or more categories
/// URL of a page for comments relating to the item.
/// A string that uniquely identifies the item.
/// Indicates when the item was published.
/// The URL of the RSS channel that the item came from.
/// The URL of where the enclosure is located
/// The length of the enclosure (how big it is in bytes).
/// The standard MIME type of the enclosure.
public void WriteItem(string title, string link, string description, DateTime pubDate, string encUrl, string encLength, string encType, string version, string dsaSignature, string releaseNotesUrl)
{
try
{
writer.WriteStartElement("item");
writer.WriteElementString("title", title);
writer.WriteElementString("link", link);
writer.WriteRaw("");
writer.WriteElementString("sparkle", "releaseNotesLink", _docs, releaseNotesUrl);

if (pubDate != null && pubDate != DateTime.MinValue && pubDate != DateTime.MaxValue)
writer.WriteElementString("pubDate", pubDate.ToString("r"));

if (!String.IsNullOrEmpty(encUrl) && !String.IsNullOrEmpty(encLength) && !String.IsNullOrEmpty(encType))
{
writer.WriteStartElement("enclosure");
writer.WriteAttributeString("url", encUrl);
writer.WriteAttributeString("length", encLength);
writer.WriteAttributeString("type", encType);
writer.WriteAttributeString("sparkle", "version", _docs, version);
writer.WriteAttributeString("sparkle", "dsaSignature", _docs, dsaSignature);
writer.WriteEndElement();
}

writer.WriteEndElement();
}
catch (Exception ex)
{
throw;
}
}

#endregion
}
}
1 change: 1 addition & 0 deletions NetSparkle/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.3" targetFramework="net40-Client" />
<package id="NLog" version="2.0.0.2000" />
<package id="NLog.Config" version="2.0.0.2000" />
</packages>