ui: vs plugin dialog

Improved dialog for finished cdbs
This commit is contained in:
wrongway88
2017-02-21 21:29:03 +01:00
parent f257a207f4
commit c895179ace
8 changed files with 1522 additions and 13 deletions
Binary file not shown.
@@ -165,6 +165,12 @@
<Compile Include="Utility\SolutionUtility.cs" />
<Compile Include="Utility\SystemUtility.cs" />
<Compile Include="Utility\StringUtility.cs" />
<Compile Include="Wizard\WindowCDBReady.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Wizard\WindowCDBReady.Designer.cs">
<DependentUpon>WindowCDBReady.cs</DependentUpon>
</Compile>
<Compile Include="Wizard\WindowCreateCDB.cs">
<SubType>Form</SubType>
</Compile>
@@ -195,6 +201,9 @@
<ManifestResourceName>VSPackage</ManifestResourceName>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Wizard\WindowCDBReady.resx">
<DependentUpon>WindowCDBReady.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Wizard\WindowCreateCDB.resx">
<DependentUpon>WindowCreateCDB.cs</DependentUpon>
</EmbeddedResource>
@@ -373,18 +373,9 @@ namespace CoatiSoftware.CoatiPlugin
if (WriteCDBToFile(creationResult._cdb, creationResult._cdbDirectory, creationResult._cdbName))
{
string title = "CDB finished";
string text = "The CDB '" + creationResult._cdbName + "' was created at directory \"" + creationResult._cdbDirectory + "\"\n";
text += "Do you want to auto-import it in Coati now?";
DialogResult result = MessageBox.Show(text, title, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
string message = Utility.NetworkProtocolUtility.CreateCreateProjectMessage(creationResult._cdbDirectory + "\\" + creationResult._cdbName + ".json", creationResult._headerDirectories);
Utility.AsynchronousClient.Send(message);
}
Wizard.WindowCDBReady dialog = new Wizard.WindowCDBReady();
dialog.setData(creationResult);
dialog.ShowDialog();
_cdbList.Refresh();
}
@@ -415,7 +406,14 @@ namespace CoatiSoftware.CoatiPlugin
{
try
{
Logging.Logging.LogInfo("Serializing " + cdb.CommandObjectCount + " command objects.");
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();
string content = cdb.SerializeJSON();
watch.Stop();
Logging.Logging.LogInfo("Done serializing: " + watch.ElapsedMilliseconds + " ms");
File.WriteAllText(directory + "\\" + fileName + ".json", content);
}
catch(Exception e)
@@ -62,6 +62,11 @@ namespace CoatiSoftware.CoatiPlugin.SolutionParser
set { _platformName = value; }
}
public int CommandObjectCount
{
get { return _commandObjects.Count; }
}
public void AddOrUpdateCommandObject(CommandObject commandObject)
{
_commandObjects.Add(commandObject); // updating is not efficient as it is
@@ -0,0 +1,108 @@
namespace CoatiSoftware.CoatiPlugin.Wizard
{
partial class WindowCDBReady
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WindowCDBReady));
this.label_message = new System.Windows.Forms.Label();
this.button_ok = new System.Windows.Forms.Button();
this.button_import = new System.Windows.Forms.Button();
this.button_open = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label_message
//
this.label_message.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label_message.Location = new System.Drawing.Point(10, 9);
this.label_message.MinimumSize = new System.Drawing.Size(290, 70);
this.label_message.Name = "label_message";
this.label_message.Size = new System.Drawing.Size(290, 70);
this.label_message.TabIndex = 0;
this.label_message.Text = "Message";
//
// button_ok
//
this.button_ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button_ok.Location = new System.Drawing.Point(12, 87);
this.button_ok.Name = "button_ok";
this.button_ok.Size = new System.Drawing.Size(75, 23);
this.button_ok.TabIndex = 1;
this.button_ok.Text = "Finish";
this.button_ok.UseVisualStyleBackColor = true;
this.button_ok.Click += new System.EventHandler(this.button_ok_Click);
//
// button_import
//
this.button_import.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button_import.Location = new System.Drawing.Point(227, 87);
this.button_import.Name = "button_import";
this.button_import.Size = new System.Drawing.Size(75, 23);
this.button_import.TabIndex = 2;
this.button_import.Text = "Import";
this.button_import.UseVisualStyleBackColor = true;
this.button_import.Click += new System.EventHandler(this.button_import_Click);
//
// button_open
//
this.button_open.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.button_open.Location = new System.Drawing.Point(111, 87);
this.button_open.Name = "button_open";
this.button_open.Size = new System.Drawing.Size(92, 23);
this.button_open.TabIndex = 3;
this.button_open.Text = "Open Folder";
this.button_open.UseVisualStyleBackColor = true;
this.button_open.Click += new System.EventHandler(this.button_open_Click);
//
// WindowCDBReady
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(314, 122);
this.ControlBox = false;
this.Controls.Add(this.button_open);
this.Controls.Add(this.button_import);
this.Controls.Add(this.button_ok);
this.Controls.Add(this.label_message);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(330, 160);
this.Name = "WindowCDBReady";
this.Text = "CDB Ready";
this.Resize += new System.EventHandler(this.WindowCDBReady_Resize);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button_ok;
private System.Windows.Forms.Button button_import;
private System.Windows.Forms.Button button_open;
private System.Windows.Forms.Label label_message;
}
}
@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CoatiSoftware.CoatiPlugin.Wizard
{
public partial class WindowCDBReady : Form
{
private string _message0 = "The CDB ";
private string _message1 = " was created at directory ";
private string _message2 = "Do you want to auto-import it in Coati now?";
private WindowCreateCDB.CreationResult _creationResult = new WindowCreateCDB.CreationResult();
public WindowCDBReady()
{
InitializeComponent();
label_message.AutoSize = false;
label_message.MaximumSize = new Size((int)((float)MaximumSize.Width * 0.8f), 0);
}
public void setData(WindowCreateCDB.CreationResult creationResult)
{
_creationResult = creationResult;
label_message.Text = _message0 + "'" + creationResult._cdbName + "'" + _message1 + "\"" + creationResult._cdbDirectory + "\".";
label_message.Text += "\n" + _message2;
}
private void button_ok_Click(object sender, EventArgs e)
{
Close();
}
private void button_open_Click(object sender, EventArgs e)
{
Utility.SystemUtility.OpenWindowsExplorerAtDirectory(_creationResult._cdbDirectory);
}
private void button_import_Click(object sender, EventArgs e)
{
string message = Utility.NetworkProtocolUtility.CreateCreateProjectMessage(_creationResult._cdbDirectory + "\\" + _creationResult._cdbName + ".json", _creationResult._headerDirectories);
Utility.AsynchronousClient.Send(message);
Close();
}
private void WindowCDBReady_Resize(object sender, EventArgs e)
{
label_message.MaximumSize = new Size((int)((float)MaximumSize.Width * 0.8f), 0);
}
}
}
File diff suppressed because it is too large Load Diff
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="acf15780-03b5-440e-a41e-db79b7043fc2" Version="0.9.4" Language="en-US" Publisher="Coati Software OG" />
<Identity Id="acf15780-03b5-440e-a41e-db79b7043fc2" Version="0.9.5" Language="en-US" Publisher="Coati Software OG" />
<DisplayName>CoatiPlugin</DisplayName>
<Description xml:space="preserve">This package allows Coati to communicate with Visual Studio and vice versa.</Description>
<MoreInfo>http://www.coati.io/</MoreInfo>