Skip to content

Commit

Permalink
Updated third party info
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffman committed Sep 15, 2016
1 parent 87def08 commit 404c8ca
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
34 changes: 26 additions & 8 deletions RopeSnake.UI.ProjectManager/AboutWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ private void InitializeThirdParty()
{
_thirdPartyList = new ObservableCollection<ThirdPartyInfo>();

foreach(var type in new[] {
typeof(NLog.Logger),
typeof(Newtonsoft.Json.JsonConvert),
typeof(SharpFileSystem.FileSystemPath),
typeof(Xceed.Wpf.Toolkit.NumericUpDown<>),
typeof(Ookii.Dialogs.Wpf.VistaOpenFileDialog) })
foreach (var type in new[] {
new ThirdPartyTypeInfo(typeof(NLog.Logger).AssemblyQualifiedName, "http://nlog-project.org/", "BSD License"),
new ThirdPartyTypeInfo(typeof(Newtonsoft.Json.JsonConvert).AssemblyQualifiedName, "http://www.newtonsoft.com/json", "MIT License"),
new ThirdPartyTypeInfo(typeof(SharpFileSystem.FileSystemPath).AssemblyQualifiedName, "https://github.com/bobvanderlinden/sharpfilesystem", "MIT License"),
new ThirdPartyTypeInfo(typeof(Xceed.Wpf.Toolkit.NumericUpDown<>).AssemblyQualifiedName, "http://wpftoolkit.codeplex.com/", "Microsoft Public License"),
new ThirdPartyTypeInfo(typeof(Ookii.Dialogs.Wpf.VistaOpenFileDialog).AssemblyQualifiedName, "http://www.ookii.org/software/dialogs/", "BSD License"),
new ThirdPartyTypeInfo(typeof(CommandLine.Parser).AssemblyQualifiedName, "https://github.com/gsscoder/commandline", "MIT License") })
{
_thirdPartyList.Add(new ThirdPartyInfo(type));
}
Expand Down Expand Up @@ -89,14 +90,17 @@ public ThirdPartyInfo(string title, string copyright, string version, string url
License = license;
}

public ThirdPartyInfo(Type typeFromAssembly)
public ThirdPartyInfo(ThirdPartyTypeInfo typeInfo)
{
var assembly = typeFromAssembly.Assembly;
var type = Type.GetType(typeInfo.TypeName);
var assembly = type.Assembly;
var assemblyName = assembly.GetName();

Title = assemblyName.Name;
Version = assemblyName.Version.ToString();
Copyright = assembly.GetCustomAttribute<AssemblyCopyrightAttribute>().Copyright;
Url = typeInfo.Url;
License = typeInfo.License;
}

private string GenerateDescription()
Expand All @@ -123,4 +127,18 @@ private string GenerateDescription()
return sb.ToString();
}
}

class ThirdPartyTypeInfo
{
public string TypeName { get; }
public string Url { get; }
public string License { get; }

public ThirdPartyTypeInfo(string typeName, string url, string license)
{
TypeName = typeName;
Url = url;
License = license;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<ApplicationIcon>Resources\ropesnake.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommandLine, Version=1.9.71.2, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
Expand Down
1 change: 1 addition & 0 deletions RopeSnake.UI.ProjectManager/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="CommandLineParser" version="1.9.71" targetFramework="net461" />
<package id="Extended.Wpf.Toolkit" version="2.9" targetFramework="net461" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="NLog" version="4.3.7" targetFramework="net461" />
Expand Down

0 comments on commit 404c8ca

Please sign in to comment.