Skip to content

Commit

Permalink
newtonsoft json update
Browse files Browse the repository at this point in the history
  • Loading branch information
atroposua committed Mar 23, 2017
1 parent 6893e50 commit 037a2db
Show file tree
Hide file tree
Showing 33 changed files with 70,358 additions and 53,754 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
Example/bin/
Example/obj/Debug/Example.MainForm.resources
Example/obj/
Binary file added .vs/iboxProSDK/v15/.suo
Binary file not shown.
2 changes: 1 addition & 1 deletion Example/App.config
Expand Up @@ -7,7 +7,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
3 changes: 1 addition & 2 deletions Example/Example.csproj
Expand Up @@ -69,8 +69,7 @@
<HintPath>..\SDK\NAudio.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SDK\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SDK_LIB, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
4 changes: 2 additions & 2 deletions Example/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Example/packages.config
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DevReactor.Toolbox.SDK" version="1.0.9.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net4" />
<package id="Newtonsoft.Json" version="10.0.1" targetFramework="net45" />
</packages>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
10,596 changes: 10,596 additions & 0 deletions packages/Newtonsoft.Json.10.0.1/lib/netstandard1.3/Newtonsoft.Json.xml

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

@@ -1,116 +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
}
}

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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 037a2db

Please sign in to comment.