diff --git a/UpdateLib/TestApp/Form1.Designer.cs b/UpdateLib/TestApp/Form1.Designer.cs index 6068cee..efabaab 100644 --- a/UpdateLib/TestApp/Form1.Designer.cs +++ b/UpdateLib/TestApp/Form1.Designer.cs @@ -28,113 +28,373 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); - this.button4 = new System.Windows.Forms.Button(); - this.updaterControl2 = new MatthiWare.UpdateLib.Controls.UpdaterControl(); - this.updaterControl1 = new MatthiWare.UpdateLib.Controls.UpdaterControl(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.customizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // - // button1 - // - this.button1.Location = new System.Drawing.Point(12, 12); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 0; - this.button1.Text = "button1"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(12, 41); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 3; - this.button2.Text = "button2"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // button3 - // - this.button3.Location = new System.Drawing.Point(12, 70); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(100, 23); - this.button3.TabIndex = 4; - this.button3.Text = "UpdateFileLoad"; - this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click); - // - // propertyGrid1 - // - this.propertyGrid1.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.propertyGrid1.Location = new System.Drawing.Point(118, 12); - this.propertyGrid1.Name = "propertyGrid1"; - this.propertyGrid1.Size = new System.Drawing.Size(266, 242); - this.propertyGrid1.TabIndex = 5; - // - // button4 - // - this.button4.Location = new System.Drawing.Point(12, 99); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(75, 23); - this.button4.TabIndex = 6; - this.button4.Text = "Updater"; - this.button4.UseVisualStyleBackColor = true; - this.button4.Click += new System.EventHandler(this.button4_Click); - // - // updaterControl2 - // - this.updaterControl2.BackColor = System.Drawing.Color.Transparent; - this.updaterControl2.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.updaterControl2.Location = new System.Drawing.Point(454, 12); - this.updaterControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.updaterControl2.Name = "updaterControl2"; - this.updaterControl2.Size = new System.Drawing.Size(20, 20); - this.updaterControl2.TabIndex = 2; - // - // updaterControl1 - // - this.updaterControl1.BackColor = System.Drawing.Color.Transparent; - this.updaterControl1.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.updaterControl1.Location = new System.Drawing.Point(12, 228); - this.updaterControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.updaterControl1.Name = "updaterControl1"; - this.updaterControl1.Size = new System.Drawing.Size(20, 20); - this.updaterControl1.TabIndex = 1; + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.editToolStripMenuItem, + this.toolsToolStripMenuItem, + this.helpToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(490, 24); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.toolStripSeparator, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.toolStripSeparator1, + this.printToolStripMenuItem, + this.printPreviewToolStripMenuItem, + this.toolStripSeparator2, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image"))); + this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.newToolStripMenuItem.Text = "&New"; + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); + this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.openToolStripMenuItem.Text = "&Open"; + // + // toolStripSeparator + // + this.toolStripSeparator.Name = "toolStripSeparator"; + this.toolStripSeparator.Size = new System.Drawing.Size(143, 6); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); + this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.saveToolStripMenuItem.Text = "&Save"; + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.saveAsToolStripMenuItem.Text = "Save &As"; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(143, 6); + // + // printToolStripMenuItem + // + this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image"))); + this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.printToolStripMenuItem.Name = "printToolStripMenuItem"; + this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.printToolStripMenuItem.Text = "&Print"; + // + // printPreviewToolStripMenuItem + // + this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image"))); + this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem"; + this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.printPreviewToolStripMenuItem.Text = "Print Pre&view"; + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(143, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + // + // editToolStripMenuItem + // + this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.undoToolStripMenuItem, + this.redoToolStripMenuItem, + this.toolStripSeparator3, + this.cutToolStripMenuItem, + this.copyToolStripMenuItem, + this.pasteToolStripMenuItem, + this.toolStripSeparator4, + this.selectAllToolStripMenuItem}); + this.editToolStripMenuItem.Name = "editToolStripMenuItem"; + this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); + this.editToolStripMenuItem.Text = "&Edit"; + // + // undoToolStripMenuItem + // + this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; + this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.undoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.undoToolStripMenuItem.Text = "&Undo"; + // + // redoToolStripMenuItem + // + this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; + this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); + this.redoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.redoToolStripMenuItem.Text = "&Redo"; + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6); + // + // cutToolStripMenuItem + // + this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image"))); + this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; + this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.cutToolStripMenuItem.Text = "Cu&t"; + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image"))); + this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.copyToolStripMenuItem.Text = "&Copy"; + // + // pasteToolStripMenuItem + // + this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image"))); + this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; + this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.pasteToolStripMenuItem.Text = "&Paste"; + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6); + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.selectAllToolStripMenuItem.Text = "Select &All"; + // + // toolsToolStripMenuItem + // + this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.customizeToolStripMenuItem, + this.optionsToolStripMenuItem}); + this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + this.toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 20); + this.toolsToolStripMenuItem.Text = "&Tools"; + // + // customizeToolStripMenuItem + // + this.customizeToolStripMenuItem.Name = "customizeToolStripMenuItem"; + this.customizeToolStripMenuItem.Size = new System.Drawing.Size(130, 22); + this.customizeToolStripMenuItem.Text = "&Customize"; + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(130, 22); + this.optionsToolStripMenuItem.Text = "&Options"; + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.contentsToolStripMenuItem, + this.indexToolStripMenuItem, + this.searchToolStripMenuItem, + this.toolStripSeparator5, + this.checkForUpdatesToolStripMenuItem, + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Text = "&Help"; + // + // contentsToolStripMenuItem + // + this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem"; + this.contentsToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.contentsToolStripMenuItem.Text = "&Contents"; + // + // indexToolStripMenuItem + // + this.indexToolStripMenuItem.Name = "indexToolStripMenuItem"; + this.indexToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.indexToolStripMenuItem.Text = "&Index"; + // + // searchToolStripMenuItem + // + this.searchToolStripMenuItem.Name = "searchToolStripMenuItem"; + this.searchToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.searchToolStripMenuItem.Text = "&Search"; + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(170, 6); + // + // checkForUpdatesToolStripMenuItem + // + this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; + this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.checkForUpdatesToolStripMenuItem.Text = "Check For &Updates"; + this.checkForUpdatesToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdatesToolStripMenuItem_Click); + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.aboutToolStripMenuItem.Text = "&About..."; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(24, 53); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 1; + this.label1.Text = "label1"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(24, 105); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 2; + this.label2.Text = "label2"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(27, 161); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(35, 13); + this.label3.TabIndex = 3; + this.label3.Text = "label3"; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(490, 266); - this.Controls.Add(this.button4); - this.Controls.Add(this.propertyGrid1); - this.Controls.Add(this.button3); - this.Controls.Add(this.button2); - this.Controls.Add(this.updaterControl2); - this.Controls.Add(this.updaterControl1); - this.Controls.Add(this.button1); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; this.Name = "Form1"; this.Text = "Test app"; this.Load += new System.EventHandler(this.Form1_Load); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Button button1; - private MatthiWare.UpdateLib.Controls.UpdaterControl updaterControl1; - private MatthiWare.UpdateLib.Controls.UpdaterControl updaterControl2; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button3; - private System.Windows.Forms.PropertyGrid propertyGrid1; - private System.Windows.Forms.Button button4; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; } } diff --git a/UpdateLib/TestApp/Form1.cs b/UpdateLib/TestApp/Form1.cs index 6fdf046..abaf194 100644 --- a/UpdateLib/TestApp/Form1.cs +++ b/UpdateLib/TestApp/Form1.cs @@ -5,6 +5,9 @@ using MatthiWare.UpdateLib.UI; using System; using System.Drawing; +using System.IO; +using System.Security.Cryptography; +using System.Text; using System.Threading; using System.Windows.Forms; @@ -12,84 +15,64 @@ namespace TestApp { public partial class Form1 : Form { - private Updater updater; - public Form1() { InitializeComponent(); - updater = Updater.Instance; - updater.UpdateURL = "http://matthiware.dev/UpdateLib/Dev/updatefile.xml"; - updater.CheckForUpdatesCompleted += Updater_CheckForUpdatesCompleted; - - updater.Initialize(); - } - - private void Updater_CheckForUpdatesCompleted(object sender, CheckForUpdatesCompletedEventArgs e) - { - if (e.Cancelled) - Logger.Debug(nameof(Updater), "Cancelled"); - - if (e.Error != null) - Logger.Error(nameof(Updater), e.Error); - - Logger.Debug(nameof(Updater), $"Version: {e.LatestVersion}"); - Logger.Debug(nameof(Updater), $"Update available: {e.UpdateAvailable}"); + Updater.Instance.CheckForUpdatesCompleted += Instance_CheckForUpdatesCompleted; } - private void button1_Click(object sender, EventArgs e) + private void Instance_CheckForUpdatesCompleted(object sender, CheckForUpdatesCompletedEventArgs e) { - DialogResult result = new MessageDialog( - "Test title", - "Version 1.0.0.0 available", - "Download update now?\nPress yes to download or no to cancel.", SystemIcons.Question, MessageBoxButtons.YesNoCancel).ShowDialog(this); + this.InvokeOnUI(() => checkForUpdatesToolStripMenuItem.Enabled = true); - if (result == DialogResult.Yes) + if (e.Cancelled || e.Error != null) { - UpdateFile updateFile = new UpdateFile(); - updateFile.VersionString = "1.0.0.0"; - updateFile.ApplicationDirectory.Files.Add(new FileEntry("test")); - updateFile.ApplicationDirectory.Files.Add(new FileEntry("Updater.exe")); - updateFile.ApplicationDirectory.Files.Add(new FileEntry("App.exe")); + this.InvokeOnUI(() => MessageDialog.Show( + this, + "Updater", + e.Cancelled ? "Cancelled" : "Error", + e.Cancelled ? "Update got cancelled" : "Please check the logs for more information.", + e.Cancelled ? SystemIcons.Warning : SystemIcons.Error, + MessageBoxButtons.OK)); + + return; + } - UpdaterForm updateForm = new UpdaterForm(updateFile); - updateForm.ShowDialog(this); + if (!e.UpdateAvailable) + { + this.InvokeOnUI(() => + MessageDialog.Show( + this, + "Updater", + "No update available!", + $"You already have the latest version ({e.LatestVersion}).", + SystemIcons.Information, + MessageBoxButtons.OK)); + + return; } } - private void button2_Click(object sender, EventArgs e) + private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e) { - UpdateFile updateFile = new UpdateFile(); - updateFile.VersionString = "1.0.0.0"; - updateFile.ApplicationDirectory.Files.Add(new FileEntry("test")); - updateFile.ApplicationDirectory.Files.Add(new FileEntry("Updater.exe")); - updateFile.ApplicationDirectory.Files.Add(new FileEntry("App.exe")); - - UpdaterForm updateForm = new UpdaterForm(updateFile); - updateForm.ShowDialog(this); - } + checkForUpdatesToolStripMenuItem.Enabled = false; - private void button3_Click(object sender, EventArgs e) - { - UpdateFile file = UpdateFile.Load("../../../MatthiWare.UpdateLib.Generator/bin/Debug/Output/updatefile.xml"); - UpdaterForm updaterForm = new UpdaterForm(file); - updaterForm.ShowDialog(this); + Updater.Instance.CheckForUpdatesAsync(); } - private void button4_Click(object sender, EventArgs e) + private void Form1_Load(object sender, EventArgs e) { - updater.CheckForUpdates(); + label1.Text = ReadFile("data/testfile1.txt"); + label2.Text = ReadFile("data/testfile2.txt"); + label3.Text = ReadFile("data/testfile3.txt"); } - private void Form1_Load(object sender, EventArgs e) + private string ReadFile(string file) { - Action test = new Action((o) => { }); - - Func test2 = new Func((i) => { return i%2==0; }); + string[] lines = File.ReadAllLines(file); - AsyncTask task = AsyncTaskFactory.StartNew(test2, 2); - Console.WriteLine(task.GetType().FullName); - + return string.Join(", ", lines); } } } diff --git a/UpdateLib/TestApp/Form1.resx b/UpdateLib/TestApp/Form1.resx index 7080a7d..dbd0356 100644 --- a/UpdateLib/TestApp/Form1.resx +++ b/UpdateLib/TestApp/Form1.resx @@ -117,4 +117,122 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAERSURBVDhPrZDbSgJRGIXnpewd6jXsjSQvIrwoI0RQMChU + 0iiDPCGiE3ZCRkvR8VzTeBhnyR5/ccaZNnPhB4t9sdf6Ln5hb8QeathNJFVFKF5C8DqL4ksDVHWGDf7j + LHyPg6NjviSaFqlu5yQYR+KpupaIkrMknCxT3Y7v/NYYb0ITK1c3BarbWWhLQ7IR0cTKReyZ6lZ0XYei + ztHpK4bAc+h1FgQijzSxMptrGIxVSO0xX3AaStFki7bUMVFmaMm/eJMGfIH/MkGzLep0AXn4h/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XERuz3hsgAOTzlqqMk6yjdllzE90UM9Wp5azlB + S1kwkeG+1CSv4mmBQPThfd6Ahqq8GYB4A11yBKmaMLQxoZyLDkGjDiZOFUhUuB+FsWsUQFiArzegtlzH + pFjPpMPA2GA2jucx2KqWK7ZWLqO7dBGP9D5KWLbfto3eAKMhi3FHBeP9GYy9PMXos4OIrYvJrzSRbWjm + wuV6EnVG4tLLiEzSExGf4w0oL05nZEDPaK+akceBuO9v4uPtFUrYo6npbzhdE/QPOQmNSiPouHYOUpaf + gvgqA/dDf9wd63G1r2SgUlAqyyq/1anYUGfG2mdXwne7bOwJUc1AinOS+NxzBpd5HWLbUhyNPvRdF5S2 + v05/54tbqvzBifWNHUvPOwLC4/CXwrv2HsB3+w6EwosJOB5ESeElfGpayGD1AmwlArHSm+W2PR1clToo + MrbT0mFTVtlbN6xFuJQar3wQz5Q9VksD+7XyPctrJdx4p5s605M5gKz8lJPSDwtGFbKboJ1blAN52vKb + PdXm80/AfDokTVu+8DfPXv9XCcIPTvjvLQ8YoakAAAAASUVORK5CYII= + + \ No newline at end of file diff --git a/UpdateLib/TestApp/Program.cs b/UpdateLib/TestApp/Program.cs index 421a787..0a911f8 100644 --- a/UpdateLib/TestApp/Program.cs +++ b/UpdateLib/TestApp/Program.cs @@ -27,6 +27,8 @@ static void Main() private static void InitializeUpdater() { Updater.Instance.Initialize(); + Updater.Instance.UpdateURL = "https://raw.githubusercontent.com/MatthiWare/UpdateLib.TestApp.UpdateExample/master/Dev/updatefile.xml"; + //Updater.Instance.UpdateURL = "http://matthiware.dev/UpdateLib/Dev/updatefile.xml"; } private static void SetupLogging() diff --git a/UpdateLib/TestApp/TestApp.csproj b/UpdateLib/TestApp/TestApp.csproj index 2b644f2..1152352 100644 --- a/UpdateLib/TestApp/TestApp.csproj +++ b/UpdateLib/TestApp/TestApp.csproj @@ -82,6 +82,17 @@ UpdateLib + + + Always + + + Always + + + Always + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk + AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR + SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF + QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP + Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD + K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G + Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p + Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 + OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 + fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ + MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 + iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// + /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// + /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox + eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G + Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt + LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme + Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak + X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI + Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es + b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f + WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// + /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q + q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe + Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// + /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P + qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu + OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg + Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W + uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw + MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb + UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W + uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk + LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc + UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC + Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ + Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc + J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// + /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb + UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB + ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ + Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq + LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM + qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG + JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a + Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN + p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P + Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo + LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 + Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei + VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 + Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd + Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp + GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb + UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb + UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg + Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 + TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz + O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ + j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y + uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 + LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf + xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L + Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj + z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI + JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ + Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl + M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD + Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 + Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb + UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO + OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj + EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac + Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB + IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// + /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG + nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// + /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ + of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// + /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 + LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg + KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a + L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 + 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf + GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb + UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 + 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 + AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb + UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a + S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb + F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z + TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 + JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b + ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 + gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// + /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta + vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 + gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c + MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc + wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 + h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X + Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb + UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 + jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb + HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH + JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA + kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM + J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp + aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG + Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf + Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel + Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ + AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd + J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej + VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo + Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN + J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi + MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// + AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA + AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ + AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD + ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA + AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA + AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// + AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// + /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// + /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// + /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 + I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk + XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf + Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi + GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// + /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// + /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// + /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// + /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 + GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ + /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ + nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy + IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// + /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// + /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// + /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG + AADwDwAA + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs index 3d1f0d0..bbd7729 100644 --- a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs +++ b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs @@ -75,7 +75,7 @@ public static void Show(Control parent) public void ShowLoader(Control parent) { - UIExtensions.InvokeOnUI(parent, (c) => + Parent.InvokeOnUI(() => { parent.SuspendLayout(); @@ -85,9 +85,9 @@ public void ShowLoader(Control parent) //parent.Size = Size; Location = new Point(0, 0); - c.Resize += ParentResize; + parent.Resize += ParentResize; - c.Controls.Add(this); + parent.Controls.Add(this); BringToFront(); @@ -118,15 +118,15 @@ public static void Hide(Control parent) public void HideLoader(Control parent) { - UIExtensions.InvokeOnUI(parent, (c) => + Parent.InvokeOnUI(() => { - c.SuspendLayout(); + parent.SuspendLayout(); - c.Resize -= ParentResize; + parent.Resize -= ParentResize; - c.Controls.Remove(this); - - c.ResumeLayout(); + parent.Controls.Remove(this); + + parent.ResumeLayout(); }); } } diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs index 2836096..84dd90d 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs @@ -31,6 +31,10 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.btnBuild = new System.Windows.Forms.Button(); + this.lblProgress = new System.Windows.Forms.Label(); + this.pbProgress = new System.Windows.Forms.ProgressBar(); + this.lblStatus = new System.Windows.Forms.Label(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.SuspendLayout(); // // label1 @@ -60,11 +64,48 @@ private void InitializeComponent() this.btnBuild.TabIndex = 3; this.btnBuild.Text = "Build"; this.btnBuild.UseVisualStyleBackColor = true; + this.btnBuild.Click += new System.EventHandler(this.btnBuild_Click); + // + // lblProgress + // + this.lblProgress.AutoSize = true; + this.lblProgress.Location = new System.Drawing.Point(139, 100); + this.lblProgress.Name = "lblProgress"; + this.lblProgress.Size = new System.Drawing.Size(79, 17); + this.lblProgress.TabIndex = 4; + this.lblProgress.Text = "Progress: 0%"; + // + // pbProgress + // + this.pbProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pbProgress.Location = new System.Drawing.Point(17, 139); + this.pbProgress.Name = "pbProgress"; + this.pbProgress.Size = new System.Drawing.Size(593, 23); + this.pbProgress.TabIndex = 5; + // + // lblStatus + // + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(14, 100); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(104, 17); + this.lblStatus.TabIndex = 6; + this.lblStatus.Text = "Status: Waiting.."; + // + // saveFileDialog + // + this.saveFileDialog.FileName = "updatefile"; + this.saveFileDialog.Filter = "Update files (.xml)|*.xml"; + this.saveFileDialog.Title = "Save location"; // // BuilderPage // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.pbProgress); + this.Controls.Add(this.lblProgress); this.Controls.Add(this.btnBuild); this.Controls.Add(this.label2); this.Controls.Add(this.label1); @@ -72,7 +113,7 @@ private void InitializeComponent() this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.MinimumSize = new System.Drawing.Size(239, 104); this.Name = "BuilderPage"; - this.Size = new System.Drawing.Size(239, 104); + this.Size = new System.Drawing.Size(629, 182); this.ResumeLayout(false); this.PerformLayout(); @@ -83,5 +124,9 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button btnBuild; + private System.Windows.Forms.Label lblProgress; + private System.Windows.Forms.ProgressBar pbProgress; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.SaveFileDialog saveFileDialog; } } diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs index efc2ddb..4a7a85e 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs @@ -8,11 +8,18 @@ using System.Windows.Forms; using System.Threading; using System.IO; +using MatthiWare.UpdateLib.UI; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.Generator.Tasks; +using MatthiWare.UpdateLib.Files; namespace MatthiWare.UpdateLib.Generator.UI.Pages { public partial class BuilderPage : PageControlBase { + private FilesPage filesPage; + private InformationPage infoPage; + public BuilderPage() { InitializeComponent(); @@ -20,8 +27,91 @@ public BuilderPage() protected override void OnPageInitialize() { - //Thread.Sleep(1000); - //throw new FileNotFoundException("Config file missing"); + saveFileDialog.InitialDirectory = new DirectoryInfo("./Output").FullName; + + PageControlBase page; + if (!TestForm.TryGetPage(nameof(FilesPage), out page)) + { + throw new KeyNotFoundException($"Unable to get {nameof(FilesPage)}"); + } + + filesPage = page as FilesPage; + + if (!TestForm.TryGetPage(nameof(InformationPage), out page)) + { + throw new KeyNotFoundException($"Unable to get {nameof(InformationPage)}"); + } + + infoPage = page as InformationPage; + + if (!filesPage.IsPageInitialized) + filesPage.InitializePage(null); + + if (!infoPage.IsPageInitialized) + infoPage.InitializePage(null); + } + + private void btnBuild_Click(object sender, EventArgs e) + { + if (saveFileDialog.ShowDialog(ParentForm) != DialogResult.OK) + return; + + pbProgress.Value = 0; + lblProgress.Text = "Progress: 0%"; + + Build(saveFileDialog.OpenFile()); + } + + private AsyncTask Build(Stream s) + { + UpdateGeneratorTask task = new UpdateGeneratorTask(filesPage.Root, infoPage); + + btnBuild.Enabled = false; + + task.TaskProgressChanged += (o, e) => + { + this.InvokeOnUI(() => + { + lblProgress.Text = $"Progress: {e.ProgressPercentage}%"; + pbProgress.Value = e.ProgressPercentage; + }); + }; + + task.TaskCompleted += (o, e) => + { + + this.InvokeOnUI(() => btnBuild.Enabled = true); + + if (e.Cancelled) + { + this.InvokeOnUI(() => lblStatus.Text = $"Status: Cancelled"); + return; + } + + if (e.Error != null) + { + this.InvokeOnUI(() => lblStatus.Text = $"Status: Error"); + + MessageDialog.Show( + ParentForm, + "Builder", + "Build error", + "Check the logs for more information", + SystemIcons.Error, + MessageBoxButtons.OK); + + return; + } + + using (s) + task.Result.Save(s); + + this.InvokeOnUI(() => lblStatus.Text = $"Status: Completed"); + }; + + lblStatus.Text = "Status: Building.."; + + return task.Start(); } } } diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx index 7080a7d..ff68a6a 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs index 5b4373b..7cd544b 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs @@ -37,6 +37,8 @@ private void InitializeComponent() this.menuAddFolder = new System.Windows.Forms.ToolStripMenuItem(); this.newFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.existingFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.lvFiles = new System.Windows.Forms.ListView(); this.clmnIcon = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -69,7 +71,7 @@ private void InitializeComponent() this.tvFolders.SelectedImageIndex = 0; this.tvFolders.Size = new System.Drawing.Size(191, 332); this.tvFolders.TabIndex = 2; - this.tvFolders.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvFolders_AfterSelect); + this.tvFolders.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.tvFolders_BeforeSelect); // // ilIcons // @@ -82,9 +84,11 @@ private void InitializeComponent() this.contextMenuRightClick.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.contextMenuRightClick.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuAddFiles, - this.menuAddFolder}); + this.menuAddFolder, + this.toolStripSeparator1, + this.deleteToolStripMenuItem}); this.contextMenuRightClick.Name = "menuTV"; - this.contextMenuRightClick.Size = new System.Drawing.Size(142, 48); + this.contextMenuRightClick.Size = new System.Drawing.Size(142, 76); // // menuAddFiles // @@ -109,6 +113,7 @@ private void InitializeComponent() this.newFolderToolStripMenuItem.Name = "newFolderToolStripMenuItem"; this.newFolderToolStripMenuItem.Size = new System.Drawing.Size(159, 22); this.newFolderToolStripMenuItem.Text = "New Folder"; + this.newFolderToolStripMenuItem.Click += new System.EventHandler(this.newFolderToolStripMenuItem_Click); // // existingFolderToolStripMenuItem // @@ -117,6 +122,20 @@ private void InitializeComponent() this.existingFolderToolStripMenuItem.Text = "Existing Folder"; this.existingFolderToolStripMenuItem.Click += new System.EventHandler(this.existingFolderToolStripMenuItem_Click); // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(138, 6); + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Enabled = false; + this.deleteToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.cross; + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(141, 22); + this.deleteToolStripMenuItem.Text = "Delete"; + this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); + // // lvFiles // this.lvFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -138,6 +157,7 @@ private void InitializeComponent() this.lvFiles.TabIndex = 3; this.lvFiles.UseCompatibleStateImageBehavior = false; this.lvFiles.View = System.Windows.Forms.View.Details; + this.lvFiles.SelectedIndexChanged += new System.EventHandler(this.lvFiles_SelectedIndexChanged); this.lvFiles.DoubleClick += new System.EventHandler(this.lvFiles_DoubleClick); // // clmnIcon @@ -212,5 +232,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem existingFolderToolStripMenuItem; private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; private System.Windows.Forms.OpenFileDialog openFileDialog; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; } } diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs index ec43366..987cfa2 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs @@ -17,8 +17,32 @@ namespace MatthiWare.UpdateLib.Generator.UI.Pages { public partial class FilesPage : PageControlBase { - private GenFolder ProjectRootFolder; - private GenFolder SelectedFolder; + private const string PROJECT_IMAGE_KEY = "project_key"; + + public GenFolder Root { get; set; } + + private GenFile _selectedFile; + private GenFile SelectedFile + { + get { return _selectedFile; } + set + { + _selectedFile = value; + if (value != null && !deleteToolStripMenuItem.Enabled) + deleteToolStripMenuItem.Enabled = true; + } + } + private GenFolder _selectedFolder; + private GenFolder SelectedFolder + { + get { return _selectedFolder; } + set + { + _selectedFolder = value; + if (value != null && !deleteToolStripMenuItem.Enabled) + deleteToolStripMenuItem.Enabled = true; + } + } public FilesPage() { @@ -30,26 +54,36 @@ protected override void OnPageInitialize() SuspendLayout(); ilIcons.Images.Add(TreeViewFolderNode.FOLDER_KEY, Properties.Resources.folder_transparent_16px); + ilIcons.Images.Add(PROJECT_IMAGE_KEY, Properties.Resources.project_16px); + + Root = new GenFolder("Update Project", null); + Root.ProtectedFolder = true; + Root.FolderTreeView.SelectedImageKey = PROJECT_IMAGE_KEY; + Root.FolderTreeView.ImageKey = PROJECT_IMAGE_KEY; + Root.FolderTreeView.ContextMenuStrip = contextMenuRightClick; - ProjectRootFolder = new GenFolder("Update Project"); - TreeViewFolderNode tvProjectRootFolder = new TreeViewFolderNode("Update Project", ProjectRootFolder); - tvProjectRootFolder.ContextMenuStrip = contextMenuRightClick; + tvFolders.Nodes.Add(Root.FolderTreeView); - tvProjectRootFolder.Folder = ProjectRootFolder; - ProjectRootFolder.FolderTreeView = tvProjectRootFolder; + GenFolder appFolder = new GenFolder("Application Folder", Root); + appFolder.ProtectedFolder = true; + appFolder.PathVariable = "%appdir%"; + appFolder.FolderTreeView.ContextMenuStrip = contextMenuRightClick; - tvFolders.Nodes.Add(tvProjectRootFolder); + Root.FolderTreeView.Nodes.Add(appFolder.FolderTreeView); folderBrowserDialog.Description = "Please select the folder to import"; + UpdateSelectedFolder(Root); + ResumeLayout(); } - - private void menuAddFiles_Click(object sender, EventArgs e) { - if (openFileDialog.ShowDialog(this.ParentForm) != DialogResult.OK) + if (openFileDialog.ShowDialog(ParentForm) != DialogResult.OK) + return; + + if (SelectedFolder == Root) return; AddExistingFileAsync(openFileDialog.FileNames.Select(file => new FileInfo(file))); @@ -57,7 +91,10 @@ private void menuAddFiles_Click(object sender, EventArgs e) private void existingFolderToolStripMenuItem_Click(object sender, EventArgs e) { - if (folderBrowserDialog.ShowDialog(this.ParentForm) != DialogResult.OK) + if (folderBrowserDialog.ShowDialog(ParentForm) != DialogResult.OK) + return; + + if (SelectedFolder == Root) return; AddExistingFolderAsync(new DirectoryInfo(folderBrowserDialog.SelectedPath)); @@ -69,13 +106,13 @@ private AsyncTask AddExistingFolderAsync(DirectoryInfo dir) AsyncTask task = AsyncTaskFactory.From(new Action(() => { - this.InvokeOnUI((p) => SuspendLayout()); + this.InvokeOnUI(() => SuspendLayout()); - AddExistingFolder(dir, ProjectRootFolder, true); + AddExistingFolder(dir, SelectedFolder, true); - this.InvokeOnUI((p) => + this.InvokeOnUI(() => { - ProjectRootFolder.FolderTreeView.Expand(); + Root.FolderTreeView.Expand(); ResumeLayout(); }); }), null); @@ -87,28 +124,19 @@ private AsyncTask AddExistingFolderAsync(DirectoryInfo dir) private void AddExistingFolder(DirectoryInfo dir, GenFolder parentFolder, bool addToUI = false) { - GenFolder folder = new GenFolder(dir.Name); - folder.FolderListView = new ListViewItemFolder(dir.Name, folder); - folder.FolderTreeView = new TreeViewFolderNode(dir.Name, folder); - + GenFolder folder = new GenFolder(dir.Name, parentFolder); folder.FolderTreeView.ContextMenuStrip = contextMenuRightClick; if (addToUI) - this.InvokeOnUI(p => lvFiles.Items.Add(folder.FolderListView)); + this.InvokeOnUI(() => lvFiles.Items.Add(folder.FolderListView)); foreach (DirectoryInfo subDir in dir.GetDirectories()) - { AddExistingFolder(subDir, folder); - } foreach (FileInfo f in dir.GetFiles()) - { - AddExistingFile(f, folder, addToUI); - } - - this.InvokeOnUI(p => parentFolder.FolderTreeView.Nodes.Add(folder.FolderTreeView)); + AddExistingFile(f, folder); - parentFolder.Directories.Add(folder); + this.InvokeOnUI(() => parentFolder.FolderTreeView.Nodes.Add(folder.FolderTreeView)); } private AsyncTask AddExistingFileAsync(IEnumerable files) @@ -132,7 +160,7 @@ private void AddExistingFile(FileInfo f, GenFolder folder, bool addToUI = false) folder.Files.Add(file); if (addToUI) - this.InvokeOnUI((page) => lvFiles.Items.Add(file.FileListView)); + this.InvokeOnUI(() => lvFiles.Items.Add(file.FileListView)); } @@ -143,17 +171,7 @@ private void EnsureExtensionIconExists(FileInfo file) Icon extensionIcon = Icon.ExtractAssociatedIcon(file.FullName); - this.InvokeOnUI((page) => ilIcons.Images.Add(file.Extension, extensionIcon)); - } - - private void tvFolders_AfterSelect(object sender, TreeViewEventArgs e) - { - TreeViewFolderNode node = e.Node as TreeViewFolderNode; - - if (node == null) - return; - - UpdateSelectedFolder(node?.Folder); + this.InvokeOnUI(() => ilIcons.Images.Add(file.Extension, extensionIcon)); } private void UpdateSelectedFolder(GenFolder folder) @@ -162,7 +180,20 @@ private void UpdateSelectedFolder(GenFolder folder) return; SelectedFolder = folder; - Console.WriteLine("Update.."); + SelectedFile = null; + + if (SelectedFolder == Root) + { + deleteToolStripMenuItem.Enabled = false; + menuAddFiles.Enabled = false; + menuAddFolder.Enabled = false; + } + else + { + menuAddFiles.Enabled = true; + menuAddFolder.Enabled = true; + } + lvFiles.SuspendLayout(); lvFiles.Items.Clear(); @@ -190,5 +221,80 @@ private void lvFiles_DoubleClick(object sender, EventArgs e) UpdateSelectedFolder(item?.Folder); } + + private void newFolderToolStripMenuItem_Click(object sender, EventArgs e) + { + if (SelectedFolder == null || SelectedFolder == Root) + return; + + InputDialog inputDlg = new InputDialog("New folder", "Please enter the folder name: ", MessageBoxButtons.OKCancel); + + if (inputDlg.ShowDialog(ParentForm) != DialogResult.OK && SelectedFolder != null) + return; + + var name = inputDlg.Input; + + GenFolder folder = new GenFolder(name, SelectedFolder); + + folder.FolderTreeView.ContextMenuStrip = contextMenuRightClick; + + SelectedFolder.Directories.Add(folder); + + this.InvokeOnUI(() => + { + SelectedFolder.FolderTreeView.Nodes.Add(folder.FolderTreeView); + lvFiles.Items.Add(folder.FolderListView); + }); + } + + private void lvFiles_SelectedIndexChanged(object sender, EventArgs e) + { + if (lvFiles.SelectedItems.Count == 0) + return; + + ListViewItemFile item = lvFiles.SelectedItems[0] as ListViewItemFile; + if (item == null) + return; + + SelectedFile = item.File; + } + + private void deleteToolStripMenuItem_Click(object sender, EventArgs e) + { + SuspendLayout(); + + deleteToolStripMenuItem.Enabled = false; + + if (SelectedFile != null) + { + SelectedFile.ParentFolder.Files.Remove(SelectedFile); + lvFiles.Items.Remove(SelectedFile.FileListView); + SelectedFile = null; + } + else if (SelectedFolder != null && SelectedFolder != Root && !SelectedFolder.ProtectedFolder) + { + SelectedFolder.ParentFolder.Directories.Remove(SelectedFolder); + tvFolders.Nodes.Remove(SelectedFolder.FolderTreeView); + + foreach (GenFile f in SelectedFolder.Files) + lvFiles.Items.Remove(f.FileListView); + + foreach (GenFolder f in SelectedFolder.Directories) + lvFiles.Items.Remove(f.FolderListView); + + SelectedFolder = null; + } + ResumeLayout(); + } + + private void tvFolders_BeforeSelect(object sender, TreeViewCancelEventArgs e) + { + TreeViewFolderNode node = e.Node as TreeViewFolderNode; + + if (node == null) + return; + + UpdateSelectedFolder(node?.Folder); + } } } diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index 631a4c2..87868e4 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -64,7 +64,7 @@ - + Form @@ -89,6 +89,12 @@ LoaderControl.cs + + Form + + + InputDialog.cs + Component @@ -132,6 +138,9 @@ LoaderControl.cs + + InputDialog.cs + BuilderPage.cs @@ -159,6 +168,8 @@ + + diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs index e17b995..47173f8 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs @@ -96,8 +96,8 @@ private UpdateFile MakeUpdateFile() appSubFolder.Files.Add(appFile); otherSubFolder.Files.Add(otherFile); - file.ApplicationDirectory.Directories.Add(appSubFolder); - file.OtherDirectory.Directories.Add(otherSubFolder); + file.Folders.Add(appSubFolder); + file.Folders.Add(otherSubFolder); Assert.AreEqual(2, file.Count); diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs index 4925b73..93be871 100644 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateFile.cs @@ -1,8 +1,10 @@ using MatthiWare.UpdateLib.Tasks; using System; +using System.Collections.Generic; using System.IO; using System.Xml; using System.Xml.Serialization; +using System.Linq; namespace MatthiWare.UpdateLib.Files { @@ -26,19 +28,15 @@ public class UpdateFile public string VersionString { get; set; } = "1.0.0.0"; /// - /// Gets the root folder of the application + /// Gets the folders of the project /// - public DirectoryEntry ApplicationDirectory { get; set; } = new DirectoryEntry("%appdir%"); - /// - /// Gets the root folder for other files related elsewhere on the filesystem - /// - public DirectoryEntry OtherDirectory { get; set; } = new DirectoryEntry("%otherdir%"); + public List Folders { get; set; } = new List(); /// - /// Gets the count of all the files in the , + /// Gets the count of all the files in the /// and their subdirectories. /// - public int Count { get { return ApplicationDirectory.Count + OtherDirectory.Count; } } + public int Count { get { return Folders.Select(d => d.Count).Sum(); } } public UpdateFile() { @@ -93,7 +91,7 @@ public static UpdateFile Load(Stream input) if (!input.CanRead) throw new ArgumentException("Stream is not readable", nameof(input)); - + XmlSerializer serializer = new XmlSerializer(typeof(UpdateFile)); XmlReader xml = new XmlTextReader(input); diff --git a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs index 6d5e2c0..bc68434 100644 --- a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] +[assembly: AssemblyVersion("0.1.1.0")] +[assembly: AssemblyFileVersion("0.1.1.0")] diff --git a/UpdateLib/UpdateLib/Resources/project_16px.png b/UpdateLib/UpdateLib/Resources/project_16px.png new file mode 100644 index 0000000..25fe536 Binary files /dev/null and b/UpdateLib/UpdateLib/Resources/project_16px.png differ diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedFilesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedFilesTask.cs index aba9666..c294721 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedFilesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedFilesTask.cs @@ -40,9 +40,8 @@ protected override void DoWork() { Action call = new Action(RecursiveCheck); - Enqueue(call, updateFile.ApplicationDirectory); - - Enqueue(call, updateFile.OtherDirectory); + foreach (DirectoryEntry dir in updateFile.Folders) + Enqueue(call, dir); AwaitWorkers(); diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs index 2d4add3..be781e2 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -50,17 +50,15 @@ protected override void DoWork() * Returns if there is anything to update */ Result.UpdateAvailable = CheckForUpdatedFiles(file, cache).AwaitTask(); - - - + if (!Result.UpdateAvailable) // no updates available return; - DialogResult result = new MessageDialog( + DialogResult result = MessageDialog.Show( "Update available", $"Version {Result.Version} available", "Update now?\nPress yes to update or no to cancel.", - SystemIcons.Question).ShowDialog(); + SystemIcons.Question); if (result != DialogResult.Yes) diff --git a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs index bc09982..bded231 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs @@ -29,8 +29,8 @@ private void PostProcessDirectory(DirectoryEntry dir) protected override void DoWork() { - PostProcessDirectory(file.ApplicationDirectory); - PostProcessDirectory(file.OtherDirectory); + foreach (DirectoryEntry dir in file.Folders) + PostProcessDirectory(dir); AwaitWorkers(); } diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs index 5b09f1a..4976acb 100644 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs +++ b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs @@ -56,8 +56,8 @@ private void FillListView() lvItems.BeginUpdate(); - AddDirectoryToListView(UpdateFile.ApplicationDirectory); - AddDirectoryToListView(UpdateFile.OtherDirectory); + foreach (DirectoryEntry dir in UpdateFile.Folders) + AddDirectoryToListView(dir); lvItems.Columns[5].Width = -1; lvItems.Columns[1].Width = -1; @@ -218,7 +218,7 @@ private void Test(ListViewItem item) private void SetImageKey(ListViewItem item, string key) { - this.InvokeOnUI((c) => item.ImageKey = key); + this.InvokeOnUI(() => item.ImageKey = key); //if (InvokeRequired) //{ // Invoke(new Action(SetImageKey), item, key); @@ -229,7 +229,7 @@ private void SetImageKey(ListViewItem item, string key) private void SetSubItemText(ListViewItem.ListViewSubItem item, string key) { - this.InvokeOnUI((c) => item.Text = key); + this.InvokeOnUI(() => item.Text = key); //if (InvokeRequired) //{ // Invoke(new Action(SetSubItemText), item, key); diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.cs b/UpdateLib/UpdateLib/UI/MessageDialog.cs index 29f1d5b..cc93861 100644 --- a/UpdateLib/UpdateLib/UI/MessageDialog.cs +++ b/UpdateLib/UpdateLib/UI/MessageDialog.cs @@ -5,6 +5,21 @@ namespace MatthiWare.UpdateLib.UI { public partial class MessageDialog : Form { + public static DialogResult Show(IWin32Window owner, string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) + { + return new MessageDialog( + title, + header, + desc, + icon, + buttons).ShowDialog(owner); + } + + public static DialogResult Show(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) + { + return Show(null, title, header, desc, icon, buttons); + } + public string Header { get { return this.lblHeader.Text; } diff --git a/UpdateLib/UpdateLib/UI/UIExtensions.cs b/UpdateLib/UpdateLib/UI/UIExtensions.cs index 050924f..881d97c 100644 --- a/UpdateLib/UpdateLib/UI/UIExtensions.cs +++ b/UpdateLib/UpdateLib/UI/UIExtensions.cs @@ -9,18 +9,21 @@ namespace MatthiWare.UpdateLib.UI { public static class UIExtensions { - public static void InvokeOnUI(this T control, Action action) where T : ISynchronizeInvoke + public static void InvokeOnUI(this T control, Action action) where T : ISynchronizeInvoke { - if (control.InvokeRequired) - { - - control.Invoke(new Action(() => action(control)), null); - } + if (control != null && control.InvokeRequired) + control.Invoke(action, null); else - { - action(control); - } - + action(); + + } + + public static TResult InvokeOnUI(this T control, Func action) where T : ISynchronizeInvoke + { + if (control != null && control.InvokeRequired) + return (TResult)control.Invoke(action, null); + else + return action(); } } diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.cs index 5352875..13e84c8 100644 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.cs +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.cs @@ -61,7 +61,7 @@ private void Page_PageUpdate(object sender, EventArgs e) delegate void _OnPageUpdate(IWizardPage page); private void OnPageUpdate(IWizardPage page) { - this.InvokeOnUI((c) => + this.InvokeOnUI(() => { if (page.IsDone && !page.IsBusy) { @@ -73,20 +73,6 @@ private void OnPageUpdate(IWizardPage page) } }); - //if (this.InvokeRequired) - //{ - // Invoke(new _OnPageUpdate(OnPageUpdate), page); - // return; - //} - - //if (page.IsDone && !page.IsBusy) - //{ - // btnNext.Enabled = true; - // if (page == pages.CurrentPage) - // btnNext.Focus(); - // if (page.NeedsExecution) - // btnNext.Text = "Next >"; - //} } private void btnPrevious_Click(object sender, EventArgs e) @@ -165,7 +151,7 @@ private void ExitUpdater() pages.Add(new FinishPage(this)); SetContentPage(pages.CurrentPage); btnPrevious.Enabled = false; - this.Close(); + Close(); } @@ -173,18 +159,19 @@ private void ExitUpdater() private void btnCancel_Click(object sender, EventArgs e) { - this.Close(); + Close(); } private bool Cancel() { - MessageDialog dlg = new MessageDialog( + DialogResult result = MessageDialog.Show( + this, "Cancel", "Cancel updating?", "Press Yes to cancel the updating process.\nPress no to keep updating.", SystemIcons.Exclamation); - return dlg.ShowDialog(this) == DialogResult.Yes; + return result == DialogResult.Yes; } private void UpdaterForm_FormClosing(object sender, FormClosingEventArgs e) diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 123b358..c315412 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -129,6 +129,7 @@ + diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index 521d2f5..c801e9b 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -25,12 +25,10 @@ public static Updater Instance get { if (instance == null) - { lock (synclock) - { - instance = new Updater(); - } - } + if (instance == null) + instance = new Updater(); + return instance; } } @@ -109,7 +107,7 @@ public CheckForUpdatesTask CheckForUpdatesAsync() throw new InvalidOperationException("The updater needs to be initialized first."); if (string.IsNullOrEmpty(UpdateURL)) - throw new ArgumentException("You need to specifify a update url", nameof(UpdateURL)); + throw new ArgumentException("You need to specifify an update url", nameof(UpdateURL)); CheckForUpdatesTask task = new CheckForUpdatesTask(UpdateURL); task.TaskCompleted += (o, e) => { CheckForUpdatesCompleted?.Invoke(task, new CheckForUpdatesCompletedEventArgs(task.Result, e)); };