mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-20 14:11:02 +10:00
Initial commit - WPinternals 2.6
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Newtonsoft.Json</id>
|
||||
<version>9.0.1</version>
|
||||
<title>Json.NET</title>
|
||||
<authors>James Newton-King</authors>
|
||||
<owners>James Newton-King</owners>
|
||||
<licenseUrl>https://raw.github.com/JamesNK/Newtonsoft.Json/master/LICENSE.md</licenseUrl>
|
||||
<projectUrl>http://www.newtonsoft.com/json</projectUrl>
|
||||
<iconUrl>http://www.newtonsoft.com/content/images/nugeticon.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
|
||||
<summary />
|
||||
<language>en-US</language>
|
||||
<tags>json</tags>
|
||||
<dependencies>
|
||||
<group targetFramework=".NETFramework4.5" />
|
||||
<group targetFramework=".NETFramework4.0" />
|
||||
<group targetFramework=".NETFramework3.5" />
|
||||
<group targetFramework=".NETFramework2.0" />
|
||||
<group targetFramework=".NETPortable4.5-net45+win8+wp8+wpa81" />
|
||||
<group targetFramework=".NETPortable4.0-net40+sl5+win8+wp8+wpa81" />
|
||||
<group targetFramework="Unsupported0.0">
|
||||
<dependency id="Microsoft.CSharp" version="4.0.1" />
|
||||
<dependency id="System.Collections" version="4.0.11" />
|
||||
<dependency id="System.Diagnostics.Debug" version="4.0.11" />
|
||||
<dependency id="System.Dynamic.Runtime" version="4.0.11" />
|
||||
<dependency id="System.Globalization" version="4.0.11" />
|
||||
<dependency id="System.IO" version="4.1.0" />
|
||||
<dependency id="System.Linq" version="4.1.0" />
|
||||
<dependency id="System.Linq.Expressions" version="4.1.0" />
|
||||
<dependency id="System.ObjectModel" version="4.0.12" />
|
||||
<dependency id="System.Reflection" version="4.1.0" />
|
||||
<dependency id="System.Reflection.Extensions" version="4.0.1" />
|
||||
<dependency id="System.Resources.ResourceManager" version="4.0.1" />
|
||||
<dependency id="System.Runtime" version="4.1.0" />
|
||||
<dependency id="System.Runtime.Extensions" version="4.1.0" />
|
||||
<dependency id="System.Runtime.Serialization.Primitives" version="4.1.1" />
|
||||
<dependency id="System.Text.Encoding" version="4.0.11" />
|
||||
<dependency id="System.Text.Encoding.Extensions" version="4.0.11" />
|
||||
<dependency id="System.Text.RegularExpressions" version="4.1.0" />
|
||||
<dependency id="System.Threading" version="4.0.11" />
|
||||
<dependency id="System.Threading.Tasks" version="4.0.11" />
|
||||
<dependency id="System.Xml.ReaderWriter" version="4.0.11" />
|
||||
<dependency id="System.Xml.XDocument" version="4.0.11" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
</package>
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+8409
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+8756
File diff suppressed because it is too large
Load Diff
+116
@@ -0,0 +1,116 @@
|
||||
param($installPath, $toolsPath, $package, $project)
|
||||
|
||||
# open json.net splash page on package install
|
||||
# don't open if json.net is installed as a dependency
|
||||
|
||||
try
|
||||
{
|
||||
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
|
||||
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
|
||||
|
||||
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
|
||||
{
|
||||
# user is installing from VS NuGet console
|
||||
# get reference to the window, the console host and the input history
|
||||
# show webpage if "install-package newtonsoft.json" was last input
|
||||
|
||||
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
|
||||
|
||||
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
|
||||
if ($prop -eq $null) { return }
|
||||
|
||||
$hostInfo = $prop.GetValue($consoleWindow)
|
||||
if ($hostInfo -eq $null) { return }
|
||||
|
||||
$history = $hostInfo.WpfConsole.InputHistory.History
|
||||
|
||||
$lastCommand = $history | select -last 1
|
||||
|
||||
if ($lastCommand)
|
||||
{
|
||||
$lastCommand = $lastCommand.Trim().ToLower()
|
||||
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# user is installing from VS NuGet dialog
|
||||
# get reference to the window, then smart output console provider
|
||||
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
|
||||
|
||||
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
|
||||
|
||||
$instance = $instanceField.GetValue($null)
|
||||
|
||||
if ($instance -eq $null) { return }
|
||||
|
||||
$consoleProvider = $consoleField.GetValue($instance)
|
||||
if ($consoleProvider -eq $null) { return }
|
||||
|
||||
$console = $consoleProvider.CreateOutputConsole($false)
|
||||
|
||||
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
if ($messagesField -eq $null) { return }
|
||||
|
||||
$messages = $messagesField.GetValue($console)
|
||||
if ($messages -eq $null) { return }
|
||||
|
||||
$operations = $messages -split "=============================="
|
||||
|
||||
$lastOperation = $operations | select -last 1
|
||||
|
||||
if ($lastOperation)
|
||||
{
|
||||
$lastOperation = $lastOperation.ToLower()
|
||||
|
||||
$lines = $lastOperation -split "`r`n"
|
||||
|
||||
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
|
||||
|
||||
if ($installMatch)
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
$pmPane = $dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item("Package Manager")
|
||||
|
||||
$selection = $pmPane.TextDocument.Selection
|
||||
$selection.StartOfDocument($false)
|
||||
$selection.EndOfDocument($true)
|
||||
|
||||
if ($selection.Text.StartsWith("Attempting to gather dependencies information for package 'Newtonsoft.Json." + $package.Version + "'"))
|
||||
{
|
||||
# don't show on upgrade
|
||||
if (!$selection.Text.Contains("Removed package"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
# stop potential errors from bubbling up
|
||||
# worst case the splash page won't open
|
||||
}
|
||||
}
|
||||
|
||||
# still yolo
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<repositories>
|
||||
<repository path="..\packages.config" />
|
||||
</repositories>
|
||||
Reference in New Issue
Block a user