Lite småjusteringar för att kunna börja från scratch
This commit is contained in:
0
.vs/CobXmlSupport/v15/Server/sqlite3/db.lock
Normal file
0
.vs/CobXmlSupport/v15/Server/sqlite3/db.lock
Normal file
BIN
.vs/CobXmlSupport/v15/Server/sqlite3/storage.ide
Normal file
BIN
.vs/CobXmlSupport/v15/Server/sqlite3/storage.ide
Normal file
Binary file not shown.
BIN
.vs/CobXmlSupport/v15/Server/sqlite3/storage.ide-shm
Normal file
BIN
.vs/CobXmlSupport/v15/Server/sqlite3/storage.ide-shm
Normal file
Binary file not shown.
BIN
.vs/CobXmlSupport/v15/Server/sqlite3/storage.ide-wal
Normal file
BIN
.vs/CobXmlSupport/v15/Server/sqlite3/storage.ide-wal
Normal file
Binary file not shown.
BIN
CobProgAid/.vs/CobProgAid/v15/Server/sqlite3/storage.ide
Normal file
BIN
CobProgAid/.vs/CobProgAid/v15/Server/sqlite3/storage.ide
Normal file
Binary file not shown.
@ -15,7 +15,7 @@
|
||||
<value>
|
||||
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<string>@"C:\testdata\Reengineering\FD_GetVehicleHistory.xml"</string>
|
||||
<string>C:\testdata\Reengineering\FD_GetVehicleHistory.xml</string>
|
||||
</ArrayOfString>
|
||||
</value>
|
||||
</setting>
|
||||
|
||||
@ -84,6 +84,7 @@
|
||||
<DependentUpon>SaveRegCopyFile.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SaverListener.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="ShowCode.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
@ -131,6 +131,12 @@ namespace CobXmlSupport
|
||||
// setLocalValues();
|
||||
//}
|
||||
|
||||
if(!File.Exists(cmbLastFile.Text))
|
||||
{
|
||||
runSetWindow(true);
|
||||
cmbLastFile.Text = S.ettingFilePath + "\\" + S.ettingActualFile;
|
||||
}
|
||||
|
||||
S.ettingFilePath = cmbLastFile.Text.Substring(0, cmbLastFile.Text.LastIndexOf("\\"));
|
||||
uniqueTags = new Dictionary<string, string>();
|
||||
uniqueAttr = new Dictionary<string, string>();
|
||||
@ -1340,8 +1346,16 @@ namespace CobXmlSupport
|
||||
long lOldSize = fileSize(SavePath + "\\FilnamnsDict.xml");
|
||||
|
||||
if (lNewSize > 0 && lNewSize >= lOldSize)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Replace(SavePath + "\\FilnamnsDict.new", SavePath + "\\FilnamnsDict.xml", SavePath + "\\FilnamnsDict.old");
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
File.Move(SavePath + "\\FilnamnsDict.new", SavePath + "\\FilnamnsDict.xml");
|
||||
File.Move(SavePath + "\\FilnamnsDict.xml", SavePath + "\\FilnamnsDict.old");
|
||||
}
|
||||
// File.Move(SavePath + "\\FilnamnsDict.xml", SavePath + "\\FilnamnsDict.old");
|
||||
// File.Move(SavePath + "\\FilnamnsDict.new", SavePath + "\\FilnamnsDict.xml");
|
||||
}
|
||||
@ -1424,12 +1438,22 @@ namespace CobXmlSupport
|
||||
}
|
||||
|
||||
private void btnSettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
runSetWindow();
|
||||
runXMLgen();
|
||||
}
|
||||
|
||||
private void runSetWindow(bool chooseFile=false)
|
||||
{
|
||||
if (setWindow == null)
|
||||
{
|
||||
setWindow = new frmSettings();
|
||||
setWindow.SL = this.sl;
|
||||
setWindow.SettingObj = new GenSetting();
|
||||
if (chooseFile)
|
||||
{
|
||||
setWindow.VisaFilVal = chooseFile;
|
||||
}
|
||||
}
|
||||
|
||||
eventRun = true;
|
||||
@ -1439,7 +1463,6 @@ namespace CobXmlSupport
|
||||
setLocalValues();
|
||||
|
||||
eventRun = false;
|
||||
runXMLgen();
|
||||
}
|
||||
|
||||
private void setLocalValues()
|
||||
|
||||
8
CobXmlSupport/Properties/Settings.Designer.cs
generated
8
CobXmlSupport/Properties/Settings.Designer.cs
generated
@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@ -12,7 +12,7 @@ namespace CobXmlSupport.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
@ -27,8 +27,8 @@ namespace CobXmlSupport.Properties {
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsi=\"http://www.w3." +
|
||||
"org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <s" +
|
||||
"tring>@\"C:\\testdata\\Reengineering\\FD_GetVehicleHistory.xml\"</string>\r\n</ArrayOfS" +
|
||||
"tring>")]
|
||||
"tring>C:\\testdata\\Reengineering\\FD_GetVehicleHistory.xml</string>\r\n</ArrayOfStri" +
|
||||
"ng>")]
|
||||
public global::System.Collections.Specialized.StringCollection LastFile {
|
||||
get {
|
||||
return ((global::System.Collections.Specialized.StringCollection)(this["LastFile"]));
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<Setting Name="LastFile" Type="System.Collections.Specialized.StringCollection" Scope="User">
|
||||
<Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
|
||||
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<string>@"C:\testdata\Reengineering\FD_GetVehicleHistory.xml"</string>
|
||||
<string>C:\testdata\Reengineering\FD_GetVehicleHistory.xml</string>
|
||||
</ArrayOfString></Value>
|
||||
</Setting>
|
||||
<Setting Name="UserName" Type="System.String" Scope="User">
|
||||
|
||||
28
CobXmlSupport/Settings.cs
Normal file
28
CobXmlSupport/Settings.cs
Normal file
@ -0,0 +1,28 @@
|
||||
namespace CobXmlSupport.Properties {
|
||||
|
||||
|
||||
// This class allows you to handle specific events on the settings class:
|
||||
// The SettingChanging event is raised before a setting's value is changed.
|
||||
// The PropertyChanged event is raised after a setting's value is changed.
|
||||
// The SettingsLoaded event is raised after the setting values are loaded.
|
||||
// The SettingsSaving event is raised before the setting values are saved.
|
||||
internal sealed partial class Settings {
|
||||
|
||||
public Settings() {
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
}
|
||||
|
||||
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
|
||||
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
}
|
||||
}
|
||||
}
|
||||
78
CobXmlSupport/frmSettings.Designer.cs
generated
78
CobXmlSupport/frmSettings.Designer.cs
generated
@ -49,6 +49,9 @@
|
||||
this.chkValues = new System.Windows.Forms.CheckBox();
|
||||
this.chkAnaTag = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.chkDisplays = new System.Windows.Forms.CheckBox();
|
||||
this.chkMvToDisp = new System.Windows.Forms.CheckBox();
|
||||
this.chkPerforms = new System.Windows.Forms.CheckBox();
|
||||
this.txtExpPrefix = new System.Windows.Forms.TextBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
@ -63,9 +66,8 @@
|
||||
this.txtFilePath = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.chkPerforms = new System.Windows.Forms.CheckBox();
|
||||
this.chkMvToDisp = new System.Windows.Forms.CheckBox();
|
||||
this.chkDisplays = new System.Windows.Forms.CheckBox();
|
||||
this.btnChooseFile = new System.Windows.Forms.Button();
|
||||
this.ofdChooseFild = new System.Windows.Forms.OpenFileDialog();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.specials.SuspendLayout();
|
||||
@ -287,6 +289,36 @@
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Utgångs inställningar";
|
||||
//
|
||||
// chkDisplays
|
||||
//
|
||||
this.chkDisplays.AutoSize = true;
|
||||
this.chkDisplays.Location = new System.Drawing.Point(14, 267);
|
||||
this.chkDisplays.Name = "chkDisplays";
|
||||
this.chkDisplays.Size = new System.Drawing.Size(104, 17);
|
||||
this.chkDisplays.TabIndex = 43;
|
||||
this.chkDisplays.Text = "Move fr Displays";
|
||||
this.chkDisplays.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkMvToDisp
|
||||
//
|
||||
this.chkMvToDisp.AutoSize = true;
|
||||
this.chkMvToDisp.Location = new System.Drawing.Point(14, 244);
|
||||
this.chkMvToDisp.Name = "chkMvToDisp";
|
||||
this.chkMvToDisp.Size = new System.Drawing.Size(111, 17);
|
||||
this.chkMvToDisp.TabIndex = 42;
|
||||
this.chkMvToDisp.Text = "Move To Displays";
|
||||
this.chkMvToDisp.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkPerforms
|
||||
//
|
||||
this.chkPerforms.AutoSize = true;
|
||||
this.chkPerforms.Location = new System.Drawing.Point(14, 220);
|
||||
this.chkPerforms.Name = "chkPerforms";
|
||||
this.chkPerforms.Size = new System.Drawing.Size(90, 17);
|
||||
this.chkPerforms.TabIndex = 41;
|
||||
this.chkPerforms.Text = "Visa Performs";
|
||||
this.chkPerforms.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtExpPrefix
|
||||
//
|
||||
this.txtExpPrefix.Location = new System.Drawing.Point(213, 51);
|
||||
@ -421,41 +453,27 @@
|
||||
this.label10.TabIndex = 44;
|
||||
this.label10.Text = "Aktuell Urspr Fil:";
|
||||
//
|
||||
// chkPerforms
|
||||
// btnChooseFile
|
||||
//
|
||||
this.chkPerforms.AutoSize = true;
|
||||
this.chkPerforms.Location = new System.Drawing.Point(14, 220);
|
||||
this.chkPerforms.Name = "chkPerforms";
|
||||
this.chkPerforms.Size = new System.Drawing.Size(90, 17);
|
||||
this.chkPerforms.TabIndex = 41;
|
||||
this.chkPerforms.Text = "Visa Performs";
|
||||
this.chkPerforms.UseVisualStyleBackColor = true;
|
||||
this.btnChooseFile.Location = new System.Drawing.Point(108, 129);
|
||||
this.btnChooseFile.Name = "btnChooseFile";
|
||||
this.btnChooseFile.Size = new System.Drawing.Size(90, 23);
|
||||
this.btnChooseFile.TabIndex = 46;
|
||||
this.btnChooseFile.Text = "Välj ursprungsfil";
|
||||
this.btnChooseFile.UseVisualStyleBackColor = true;
|
||||
this.btnChooseFile.Visible = false;
|
||||
this.btnChooseFile.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// chkMvToDisp
|
||||
// ofdChooseFild
|
||||
//
|
||||
this.chkMvToDisp.AutoSize = true;
|
||||
this.chkMvToDisp.Location = new System.Drawing.Point(14, 244);
|
||||
this.chkMvToDisp.Name = "chkMvToDisp";
|
||||
this.chkMvToDisp.Size = new System.Drawing.Size(111, 17);
|
||||
this.chkMvToDisp.TabIndex = 42;
|
||||
this.chkMvToDisp.Text = "Move To Displays";
|
||||
this.chkMvToDisp.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkDisplays
|
||||
//
|
||||
this.chkDisplays.AutoSize = true;
|
||||
this.chkDisplays.Location = new System.Drawing.Point(14, 267);
|
||||
this.chkDisplays.Name = "chkDisplays";
|
||||
this.chkDisplays.Size = new System.Drawing.Size(104, 17);
|
||||
this.chkDisplays.TabIndex = 43;
|
||||
this.chkDisplays.Text = "Move fr Displays";
|
||||
this.chkDisplays.UseVisualStyleBackColor = true;
|
||||
this.ofdChooseFild.InitialDirectory = "Documents";
|
||||
//
|
||||
// frmSettings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(557, 518);
|
||||
this.Controls.Add(this.btnChooseFile);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.txtFilePath);
|
||||
@ -525,5 +543,7 @@
|
||||
private System.Windows.Forms.CheckBox chkPerforms;
|
||||
private System.Windows.Forms.CheckBox chkMvToDisp;
|
||||
private System.Windows.Forms.CheckBox chkDisplays;
|
||||
private System.Windows.Forms.Button btnChooseFile;
|
||||
private System.Windows.Forms.OpenFileDialog ofdChooseFild;
|
||||
}
|
||||
}
|
||||
@ -326,7 +326,10 @@ namespace CobXmlSupport
|
||||
txtExpPrefix.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool VisaFilVal { set {
|
||||
btnChooseFile.Visible = value;
|
||||
btnChooseFile.Refresh();
|
||||
} }
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
@ -391,6 +394,24 @@ namespace CobXmlSupport
|
||||
CompanyTmp = txtCompanyName.Text = S.ettingCompany;
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ofdChooseFild.Title = "Välj en befintlig xml-fil";
|
||||
ofdChooseFild.FileName = this.txtActualFile.Text;
|
||||
ofdChooseFild.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
ofdChooseFild.Filter= "xml files (*.xml)|*.xml|All files (*.*)|*.*";
|
||||
ofdChooseFild.Multiselect = false;
|
||||
if (ofdChooseFild.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
txtActualFile.Text = ofdChooseFild.SafeFileName;
|
||||
txtFilePath.Text = System.IO.Path.GetDirectoryName(ofdChooseFild.FileName);
|
||||
txtActualFile.Refresh();
|
||||
txtFilePath.Refresh();
|
||||
}
|
||||
else MessageBox.Show("Programmet kommer att krasha om ingen fil väljs!");
|
||||
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
chkAnaTag.Checked = tmpChkAnaTag;
|
||||
|
||||
@ -117,6 +117,9 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ofdChooseFild.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
||||
BIN
packages/Newtonsoft.Json.6.0.8/Newtonsoft.Json.6.0.8.nupkg
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/Newtonsoft.Json.6.0.8.nupkg
vendored
Normal file
Binary file not shown.
BIN
packages/Newtonsoft.Json.6.0.8/lib/net20/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/lib/net20/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
9327
packages/Newtonsoft.Json.6.0.8/lib/net20/Newtonsoft.Json.xml
vendored
Normal file
9327
packages/Newtonsoft.Json.6.0.8/lib/net20/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.6.0.8/lib/net35/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/lib/net35/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
8470
packages/Newtonsoft.Json.6.0.8/lib/net35/Newtonsoft.Json.xml
vendored
Normal file
8470
packages/Newtonsoft.Json.6.0.8/lib/net35/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.6.0.8/lib/net40/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/lib/net40/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
8777
packages/Newtonsoft.Json.6.0.8/lib/net40/Newtonsoft.Json.xml
vendored
Normal file
8777
packages/Newtonsoft.Json.6.0.8/lib/net40/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
8777
packages/Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.xml
vendored
Normal file
8777
packages/Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.6.0.8/lib/netcore45/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/lib/netcore45/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
8302
packages/Newtonsoft.Json.6.0.8/lib/netcore45/Newtonsoft.Json.xml
vendored
Normal file
8302
packages/Newtonsoft.Json.6.0.8/lib/netcore45/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.6.0.8/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
7955
packages/Newtonsoft.Json.6.0.8/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.xml
vendored
Normal file
7955
packages/Newtonsoft.Json.6.0.8/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.6.0.8/lib/portable-net45+wp80+win8+wpa81+aspnetcore50/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.6.0.8/lib/portable-net45+wp80+win8+wpa81+aspnetcore50/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
8302
packages/Newtonsoft.Json.6.0.8/lib/portable-net45+wp80+win8+wpa81+aspnetcore50/Newtonsoft.Json.xml
vendored
Normal file
8302
packages/Newtonsoft.Json.6.0.8/lib/portable-net45+wp80+win8+wpa81+aspnetcore50/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
112
packages/Newtonsoft.Json.6.0.8/tools/install.ps1
vendored
Normal file
112
packages/Newtonsoft.Json.6.0.8/tools/install.ps1
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
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://james.newtonking.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("Installing 'Newtonsoft.Json "))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
# stop potential errors from bubbling up
|
||||
# worst case the splash page won't open
|
||||
}
|
||||
}
|
||||
|
||||
# still yolo
|
||||
4
packages/repositories.config
Normal file
4
packages/repositories.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<repositories>
|
||||
<repository path="..\CobXmlSupport\packages.config" />
|
||||
</repositories>
|
||||
Reference in New Issue
Block a user