Browse Source

创建版本构建工具(准备编写更新)

yuzhengyang 8 years ago
parent
commit
04498f793e

+ 6 - 8
Fork.Net/Oreo.VersionBuilder/Models/VersionModel.cs

@@ -1,4 +1,6 @@
-namespace Oreo.VersionBuilder.Models
+using System.Collections.Generic;
+
+namespace Oreo.VersionBuilder.Models
 {
     public class VersionModel
     {
@@ -37,11 +39,7 @@
         /// <summary>
         /// 文件列表
         /// </summary>
-        public VersionFile[] FileList { get; set; }
-        /// <summary>
-        /// 属于插件(用于更新插件清单)
-        /// </summary>
-        public bool IsPlugin { get; set; }
+        public List<VersionFile> FileList { get; set; }
         /// <summary>
         /// 插件名称
         /// </summary>
@@ -66,8 +64,8 @@
         /// </summary>
         public string FileMD5 { get; set; }
         /// <summary>
-        /// 删除文件(用于清理冗余)
+        /// 清理文件(用于清理冗余)
         /// </summary>
-        public bool Delete { get; set; }
+        public bool IsClean { get; set; }
     }
 }

+ 176 - 160
Fork.Net/Oreo.VersionBuilder/Views/MainForm.Designer.cs

@@ -28,7 +28,8 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
             this.TbVersionDesc = new System.Windows.Forms.TextBox();
             this.label3 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
@@ -36,13 +37,11 @@
             this.TbVersionNumber = new System.Windows.Forms.TextBox();
             this.TbCodeName = new System.Windows.Forms.TextBox();
             this.label12 = new System.Windows.Forms.Label();
-            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.DgFileList = new System.Windows.Forms.DataGridView();
             this.TbPluginEntry = new System.Windows.Forms.TextBox();
             this.TbPluginName = new System.Windows.Forms.TextBox();
-            this.CbIsPlugin = new System.Windows.Forms.CheckBox();
             this.label11 = new System.Windows.Forms.Label();
             this.label10 = new System.Windows.Forms.Label();
-            this.label9 = new System.Windows.Forms.Label();
             this.TbServerPath = new System.Windows.Forms.TextBox();
             this.label4 = new System.Windows.Forms.Label();
             this.TbAfterUpdateKillProcess = new System.Windows.Forms.TextBox();
@@ -60,31 +59,33 @@
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.生成ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
             this.生成配置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.生成配置到指定目录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
             this.打开默认配置目录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.查看帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
+            this.TsslRunStatus = new System.Windows.Forms.ToolStripStatusLabel();
             this.PnMain = new System.Windows.Forms.Panel();
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.groupBox2 = new System.Windows.Forms.GroupBox();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
-            this.ClServer = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ClLocal = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ClUpdate = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.ClDelete = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
-            this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
-            this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.BtClear = new System.Windows.Forms.Button();
+            this.BtImport = new System.Windows.Forms.Button();
+            this.BtAddFile = new System.Windows.Forms.Button();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.ClFileListServer = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ClFileListLocal = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ClFileListMD5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ClFileListClean = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            ((System.ComponentModel.ISupportInitialize)(this.DgFileList)).BeginInit();
             this.MsMain.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.PnMain.SuspendLayout();
-            this.groupBox1.SuspendLayout();
-            this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
             // TbVersionDesc
@@ -140,67 +141,68 @@
             // label12
             // 
             this.label12.AutoSize = true;
-            this.label12.Location = new System.Drawing.Point(18, 144);
+            this.label12.Location = new System.Drawing.Point(18, 120);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(89, 12);
             this.label12.TabIndex = 30;
             this.label12.Text = "更新文件列表:";
             // 
-            // dataGridView1
-            // 
-            this.dataGridView1.AllowUserToAddRows = false;
-            this.dataGridView1.AllowUserToDeleteRows = false;
-            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
-            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
-            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
-            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.ClServer,
-            this.ClLocal,
-            this.ClUpdate,
-            this.ClDelete});
-            this.dataGridView1.Location = new System.Drawing.Point(20, 170);
-            this.dataGridView1.Name = "dataGridView1";
-            this.dataGridView1.ReadOnly = true;
-            this.dataGridView1.RowHeadersVisible = false;
-            this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
-            this.dataGridView1.RowTemplate.Height = 23;
-            this.dataGridView1.Size = new System.Drawing.Size(521, 388);
-            this.dataGridView1.TabIndex = 29;
+            // DgFileList
+            // 
+            this.DgFileList.AllowUserToAddRows = false;
+            this.DgFileList.AllowUserToResizeColumns = false;
+            this.DgFileList.AllowUserToResizeRows = false;
+            this.DgFileList.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
+            this.DgFileList.BackgroundColor = System.Drawing.Color.White;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.DgFileList.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
+            this.DgFileList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+            this.DgFileList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.ClFileListServer,
+            this.ClFileListLocal,
+            this.ClFileListMD5,
+            this.ClFileListClean});
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.GradientActiveCaption;
+            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black;
+            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.DgFileList.DefaultCellStyle = dataGridViewCellStyle2;
+            this.DgFileList.Location = new System.Drawing.Point(20, 142);
+            this.DgFileList.Name = "DgFileList";
+            this.DgFileList.RowHeadersVisible = false;
+            this.DgFileList.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
+            this.DgFileList.RowTemplate.Height = 23;
+            this.DgFileList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+            this.DgFileList.Size = new System.Drawing.Size(521, 416);
+            this.DgFileList.TabIndex = 29;
             // 
             // TbPluginEntry
             // 
-            this.TbPluginEntry.Location = new System.Drawing.Point(155, 108);
+            this.TbPluginEntry.Location = new System.Drawing.Point(155, 84);
             this.TbPluginEntry.Name = "TbPluginEntry";
             this.TbPluginEntry.Size = new System.Drawing.Size(213, 21);
             this.TbPluginEntry.TabIndex = 28;
             // 
             // TbPluginName
             // 
-            this.TbPluginName.Location = new System.Drawing.Point(155, 80);
+            this.TbPluginName.Location = new System.Drawing.Point(155, 56);
             this.TbPluginName.Name = "TbPluginName";
             this.TbPluginName.Size = new System.Drawing.Size(213, 21);
             this.TbPluginName.TabIndex = 27;
             // 
-            // CbIsPlugin
-            // 
-            this.CbIsPlugin.AutoSize = true;
-            this.CbIsPlugin.Location = new System.Drawing.Point(155, 57);
-            this.CbIsPlugin.Name = "CbIsPlugin";
-            this.CbIsPlugin.Size = new System.Drawing.Size(15, 14);
-            this.CbIsPlugin.TabIndex = 26;
-            this.CbIsPlugin.UseVisualStyleBackColor = true;
-            // 
             // label11
             // 
             this.label11.AutoSize = true;
-            this.label11.Location = new System.Drawing.Point(18, 112);
+            this.label11.Location = new System.Drawing.Point(18, 88);
             this.label11.Name = "label11";
             this.label11.Size = new System.Drawing.Size(89, 12);
             this.label11.TabIndex = 25;
@@ -209,21 +211,12 @@
             // label10
             // 
             this.label10.AutoSize = true;
-            this.label10.Location = new System.Drawing.Point(18, 85);
+            this.label10.Location = new System.Drawing.Point(18, 61);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(65, 12);
             this.label10.TabIndex = 24;
             this.label10.Text = "插件名称:";
             // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Location = new System.Drawing.Point(18, 58);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(65, 12);
-            this.label9.TabIndex = 23;
-            this.label9.Text = "独立插件:";
-            // 
             // TbServerPath
             // 
             this.TbServerPath.Location = new System.Drawing.Point(155, 28);
@@ -334,26 +327,26 @@
             // 新建ToolStripMenuItem
             // 
             this.新建ToolStripMenuItem.Name = "新建ToolStripMenuItem";
-            this.新建ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.新建ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.新建ToolStripMenuItem.Text = "新建";
             this.新建ToolStripMenuItem.Click += new System.EventHandler(this.新建ToolStripMenuItem_Click);
             // 
             // 打开ToolStripMenuItem
             // 
             this.打开ToolStripMenuItem.Name = "打开ToolStripMenuItem";
-            this.打开ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.打开ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.打开ToolStripMenuItem.Text = "打开";
             this.打开ToolStripMenuItem.Click += new System.EventHandler(this.打开ToolStripMenuItem_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
+            this.toolStripSeparator1.Size = new System.Drawing.Size(97, 6);
             // 
             // 退出ToolStripMenuItem
             // 
             this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
-            this.退出ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.退出ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.退出ToolStripMenuItem.Text = "退出";
             this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
             // 
@@ -368,18 +361,6 @@
             this.生成ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
             this.生成ToolStripMenuItem.Text = "生成";
             // 
-            // statusStrip1
-            // 
-            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripStatusLabel1,
-            this.toolStripProgressBar1,
-            this.toolStripStatusLabel2});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 589);
-            this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Size = new System.Drawing.Size(584, 22);
-            this.statusStrip1.TabIndex = 25;
-            this.statusStrip1.Text = "statusStrip1";
-            // 
             // 生成配置ToolStripMenuItem
             // 
             this.生成配置ToolStripMenuItem.Name = "生成配置ToolStripMenuItem";
@@ -392,6 +373,7 @@
             this.生成配置到指定目录ToolStripMenuItem.Name = "生成配置到指定目录ToolStripMenuItem";
             this.生成配置到指定目录ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
             this.生成配置到指定目录ToolStripMenuItem.Text = "生成配置到指定目录";
+            this.生成配置到指定目录ToolStripMenuItem.Click += new System.EventHandler(this.生成配置到指定目录ToolStripMenuItem_Click);
             // 
             // toolStripSeparator2
             // 
@@ -416,9 +398,32 @@
             // 查看帮助ToolStripMenuItem
             // 
             this.查看帮助ToolStripMenuItem.Name = "查看帮助ToolStripMenuItem";
-            this.查看帮助ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.查看帮助ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
             this.查看帮助ToolStripMenuItem.Text = "查看帮助";
             // 
+            // statusStrip1
+            // 
+            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripStatusLabel1,
+            this.TsslRunStatus});
+            this.statusStrip1.Location = new System.Drawing.Point(0, 589);
+            this.statusStrip1.Name = "statusStrip1";
+            this.statusStrip1.Size = new System.Drawing.Size(584, 22);
+            this.statusStrip1.TabIndex = 25;
+            this.statusStrip1.Text = "statusStrip1";
+            // 
+            // toolStripStatusLabel1
+            // 
+            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(44, 17);
+            this.toolStripStatusLabel1.Text = "状态:";
+            // 
+            // TsslRunStatus
+            // 
+            this.TsslRunStatus.Name = "TsslRunStatus";
+            this.TsslRunStatus.Size = new System.Drawing.Size(108, 17);
+            this.TsslRunStatus.Text = "ready to building";
+            // 
             // PnMain
             // 
             this.PnMain.AutoScroll = true;
@@ -431,32 +436,35 @@
             this.PnMain.Size = new System.Drawing.Size(584, 564);
             this.PnMain.TabIndex = 26;
             // 
-            // groupBox1
+            // groupBox3
             // 
-            this.groupBox1.Controls.Add(this.TbVersionDesc);
-            this.groupBox1.Controls.Add(this.label1);
-            this.groupBox1.Controls.Add(this.label3);
-            this.groupBox1.Controls.Add(this.TbCodeName);
-            this.groupBox1.Controls.Add(this.label2);
-            this.groupBox1.Controls.Add(this.TbVersionNumber);
-            this.groupBox1.Location = new System.Drawing.Point(3, 18);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(561, 266);
-            this.groupBox1.TabIndex = 24;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "版本概述";
+            this.groupBox3.Controls.Add(this.TbBeforeUpdateStartProcess);
+            this.groupBox3.Controls.Add(this.TbAfterUpdateKillProcess);
+            this.groupBox3.Controls.Add(this.label7);
+            this.groupBox3.Controls.Add(this.label6);
+            this.groupBox3.Controls.Add(this.TbAfterUpdateStartProcess);
+            this.groupBox3.Controls.Add(this.label8);
+            this.groupBox3.Controls.Add(this.label5);
+            this.groupBox3.Controls.Add(this.TbBeforeUpdateKillProcess);
+            this.groupBox3.Location = new System.Drawing.Point(3, 901);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(561, 332);
+            this.groupBox3.TabIndex = 26;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "其他操作";
             // 
             // groupBox2
             // 
+            this.groupBox2.Controls.Add(this.BtClear);
+            this.groupBox2.Controls.Add(this.BtImport);
+            this.groupBox2.Controls.Add(this.BtAddFile);
             this.groupBox2.Controls.Add(this.label12);
             this.groupBox2.Controls.Add(this.label4);
-            this.groupBox2.Controls.Add(this.dataGridView1);
+            this.groupBox2.Controls.Add(this.DgFileList);
             this.groupBox2.Controls.Add(this.TbServerPath);
             this.groupBox2.Controls.Add(this.TbPluginEntry);
-            this.groupBox2.Controls.Add(this.label9);
             this.groupBox2.Controls.Add(this.TbPluginName);
             this.groupBox2.Controls.Add(this.label10);
-            this.groupBox2.Controls.Add(this.CbIsPlugin);
             this.groupBox2.Controls.Add(this.label11);
             this.groupBox2.Location = new System.Drawing.Point(3, 305);
             this.groupBox2.Name = "groupBox2";
@@ -465,67 +473,74 @@
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "文件清单";
             // 
-            // groupBox3
+            // BtClear
             // 
-            this.groupBox3.Controls.Add(this.TbBeforeUpdateStartProcess);
-            this.groupBox3.Controls.Add(this.TbAfterUpdateKillProcess);
-            this.groupBox3.Controls.Add(this.label7);
-            this.groupBox3.Controls.Add(this.label6);
-            this.groupBox3.Controls.Add(this.TbAfterUpdateStartProcess);
-            this.groupBox3.Controls.Add(this.label8);
-            this.groupBox3.Controls.Add(this.label5);
-            this.groupBox3.Controls.Add(this.TbBeforeUpdateKillProcess);
-            this.groupBox3.Location = new System.Drawing.Point(3, 901);
-            this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(561, 332);
-            this.groupBox3.TabIndex = 26;
-            this.groupBox3.TabStop = false;
-            this.groupBox3.Text = "其他操作";
+            this.BtClear.Location = new System.Drawing.Point(466, 115);
+            this.BtClear.Name = "BtClear";
+            this.BtClear.Size = new System.Drawing.Size(75, 23);
+            this.BtClear.TabIndex = 33;
+            this.BtClear.Text = "清空";
+            this.BtClear.UseVisualStyleBackColor = true;
+            this.BtClear.Click += new System.EventHandler(this.BtClear_Click);
             // 
-            // ClServer
+            // BtImport
             // 
-            this.ClServer.FillWeight = 40F;
-            this.ClServer.HeaderText = "服务器路径";
-            this.ClServer.Name = "ClServer";
-            this.ClServer.ReadOnly = true;
+            this.BtImport.Location = new System.Drawing.Point(304, 115);
+            this.BtImport.Name = "BtImport";
+            this.BtImport.Size = new System.Drawing.Size(75, 23);
+            this.BtImport.TabIndex = 32;
+            this.BtImport.Text = "批量导入";
+            this.BtImport.UseVisualStyleBackColor = true;
+            this.BtImport.Click += new System.EventHandler(this.BtImport_Click);
             // 
-            // ClLocal
+            // BtAddFile
             // 
-            this.ClLocal.FillWeight = 40F;
-            this.ClLocal.HeaderText = "本地路径";
-            this.ClLocal.Name = "ClLocal";
-            this.ClLocal.ReadOnly = true;
+            this.BtAddFile.Location = new System.Drawing.Point(385, 115);
+            this.BtAddFile.Name = "BtAddFile";
+            this.BtAddFile.Size = new System.Drawing.Size(75, 23);
+            this.BtAddFile.TabIndex = 31;
+            this.BtAddFile.Text = "添加文件";
+            this.BtAddFile.UseVisualStyleBackColor = true;
+            this.BtAddFile.Click += new System.EventHandler(this.BtAddFile_Click);
             // 
-            // ClUpdate
+            // groupBox1
             // 
-            this.ClUpdate.FillWeight = 10F;
-            this.ClUpdate.HeaderText = "更新";
-            this.ClUpdate.Name = "ClUpdate";
-            this.ClUpdate.ReadOnly = true;
+            this.groupBox1.Controls.Add(this.TbVersionDesc);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.TbCodeName);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.TbVersionNumber);
+            this.groupBox1.Location = new System.Drawing.Point(3, 18);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(561, 266);
+            this.groupBox1.TabIndex = 24;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "版本概述";
             // 
-            // ClDelete
+            // ClFileListServer
             // 
-            this.ClDelete.FillWeight = 10F;
-            this.ClDelete.HeaderText = "删除";
-            this.ClDelete.Name = "ClDelete";
-            this.ClDelete.ReadOnly = true;
+            this.ClFileListServer.FillWeight = 35F;
+            this.ClFileListServer.HeaderText = "服务器路径";
+            this.ClFileListServer.Name = "ClFileListServer";
             // 
-            // toolStripStatusLabel1
+            // ClFileListLocal
             // 
-            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
-            this.toolStripStatusLabel1.Size = new System.Drawing.Size(44, 17);
-            this.toolStripStatusLabel1.Text = "状态:";
+            this.ClFileListLocal.FillWeight = 35F;
+            this.ClFileListLocal.HeaderText = "本地路径";
+            this.ClFileListLocal.Name = "ClFileListLocal";
             // 
-            // toolStripProgressBar1
+            // ClFileListMD5
             // 
-            this.toolStripProgressBar1.Name = "toolStripProgressBar1";
-            this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16);
+            this.ClFileListMD5.FillWeight = 20F;
+            this.ClFileListMD5.HeaderText = "MD5";
+            this.ClFileListMD5.Name = "ClFileListMD5";
             // 
-            // toolStripStatusLabel2
+            // ClFileListClean
             // 
-            this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
-            this.toolStripStatusLabel2.Size = new System.Drawing.Size(108, 17);
-            this.toolStripStatusLabel2.Text = "ready to building";
+            this.ClFileListClean.FillWeight = 10F;
+            this.ClFileListClean.HeaderText = "清理";
+            this.ClFileListClean.Name = "ClFileListClean";
             // 
             // MainForm
             // 
@@ -540,18 +555,19 @@
             this.Name = "MainForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "版本生成器";
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+            this.Load += new System.EventHandler(this.MainForm_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.DgFileList)).EndInit();
             this.MsMain.ResumeLayout(false);
             this.MsMain.PerformLayout();
             this.statusStrip1.ResumeLayout(false);
             this.statusStrip1.PerformLayout();
             this.PnMain.ResumeLayout(false);
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
-            this.groupBox2.ResumeLayout(false);
-            this.groupBox2.PerformLayout();
             this.groupBox3.ResumeLayout(false);
             this.groupBox3.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -566,10 +582,8 @@
         private System.Windows.Forms.TextBox TbCodeName;
         private System.Windows.Forms.TextBox TbPluginEntry;
         private System.Windows.Forms.TextBox TbPluginName;
-        private System.Windows.Forms.CheckBox CbIsPlugin;
         private System.Windows.Forms.Label label11;
         private System.Windows.Forms.Label label10;
-        private System.Windows.Forms.Label label9;
         private System.Windows.Forms.TextBox TbServerPath;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.TextBox TbAfterUpdateKillProcess;
@@ -581,7 +595,7 @@
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.Label label5;
         private System.Windows.Forms.Label label12;
-        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.DataGridView DgFileList;
         private System.Windows.Forms.MenuStrip MsMain;
         private System.Windows.Forms.ToolStripMenuItem 文件ToolStripMenuItem;
         private System.Windows.Forms.StatusStrip statusStrip1;
@@ -600,12 +614,14 @@
         private System.Windows.Forms.GroupBox groupBox3;
         private System.Windows.Forms.GroupBox groupBox2;
         private System.Windows.Forms.GroupBox groupBox1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn ClServer;
-        private System.Windows.Forms.DataGridViewTextBoxColumn ClLocal;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn ClUpdate;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn ClDelete;
         private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
-        private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
-        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
+        private System.Windows.Forms.ToolStripStatusLabel TsslRunStatus;
+        private System.Windows.Forms.Button BtImport;
+        private System.Windows.Forms.Button BtAddFile;
+        private System.Windows.Forms.Button BtClear;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ClFileListServer;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ClFileListLocal;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ClFileListMD5;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn ClFileListClean;
     }
 }

+ 134 - 41
Fork.Net/Oreo.VersionBuilder/Views/MainForm.cs

@@ -6,37 +6,148 @@ using System.ComponentModel;
 using System.Data;
 using System.Diagnostics;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using Y.Utils.DataUtils.Collections;
 using Y.Utils.DataUtils.JsonUtils;
+using Y.Utils.IOUtils.FileUtils;
 using Y.Utils.IOUtils.TxtUtils;
 
 namespace Oreo.VersionBuilder.Views
 {
     public partial class MainForm : Form
     {
+        string NowOpenFile = "";
         public MainForm()
         {
             InitializeComponent();
         }
-
-
+        private void MainForm_Load(object sender, EventArgs e)
+        {
+        }
+        #region 菜单项
+        private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            Clear();
+            TsslRunStatus.Text = "新建版本文件";
+        }
+        private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            Clear();
+            OpenFileDialog fileDialog = new OpenFileDialog();
+            fileDialog.Filter = "版本文件|*.version|文本文档|*.txt";
+            if (fileDialog.ShowDialog() == DialogResult.OK)
+            {
+                string file = fileDialog.FileName;
+                NowOpenFile = file;
+                if (!string.IsNullOrWhiteSpace(file))
+                {
+                    VersionModel vm = JsonTool.ToObjFromFile<VersionModel>(file);
+                    if (vm != null)
+                    {
+                        TbCodeName.Text = vm.CodeName;
+                        TbVersionNumber.Text = vm.VersionNumber;
+                        TbVersionDesc.Text = vm.VersionDesc;
+                        TbServerPath.Text = vm.ServerPath;
+                        TbPluginName.Text = vm.PluginName;
+                        TbPluginEntry.Text = vm.PluginEntry;
+                        TbBeforeUpdateStartProcess.Text = string.Join(",", vm.BeforeUpdateStartProcess);
+                        TbBeforeUpdateKillProcess.Text = string.Join(",", vm.BeforeUpdateKillProcess);
+                        TbAfterUpdateStartProcess.Text = string.Join(",", vm.AfterUpdateStartProcess);
+                        TbAfterUpdateKillProcess.Text = string.Join(",", vm.AfterUpdateKillProcess);
+                        if (ListTool.HasElements(vm.FileList))
+                        {
+                            vm.FileList.ForEach(f =>
+                            {
+                                DgFileList.Rows.Add(new object[] {
+                                    f.ServerFile,f.LocalFile,f.IsClean
+                                });
+                            });
+                        }
+                        TsslRunStatus.Text = "已打开:" + Path.GetFileName(NowOpenFile);
+                    }
+                    else
+                    {
+                        TsslRunStatus.Text = "打开:" + Path.GetFileName(NowOpenFile) + " 失败!";
+                    }
+                }
+            }
+        }
+        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            Close();
+        }
         private void 生成配置ToolStripMenuItem_Click(object sender, EventArgs e)
         {
             VersionModel vm = GatherModel();
             string vmJson = JsonTool.ToStr(vm);
-            TxtTool.Create(R.Paths.VersionFile + string.Format("{0}.version", DateTime.Now.ToString("MMddHHmmss")), vmJson);
-        }
-
-
+            string vmFile = string.IsNullOrWhiteSpace(NowOpenFile) ?
+                R.Paths.VersionFile + string.Format("{0}.version", DateTime.Now.ToString("MMddHHmmss")) :
+                NowOpenFile;
 
+            TxtTool.Create(vmFile, vmJson);
+            TsslRunStatus.Text = "构建成功:" + Path.GetFileName(vmFile);
+        }
+        private void 生成配置到指定目录ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            SaveFileDialog fileDialog = new SaveFileDialog();
+            fileDialog.InitialDirectory = R.Paths.VersionFile;
+            fileDialog.Filter = "版本文件|*.version";
+            if (fileDialog.ShowDialog() == DialogResult.OK)
+            {
+                VersionModel vm = GatherModel();
+                string vmJson = JsonTool.ToStr(vm);
+                TxtTool.Create(fileDialog.FileName, vmJson);
+                TsslRunStatus.Text = "构建成功:" + Path.GetFileName(fileDialog.FileName);
+            }
+        }
         private void 打开默认配置目录ToolStripMenuItem_Click(object sender, EventArgs e)
         {
             Process.Start("explorer", R.Paths.VersionFile);
+            TsslRunStatus.Text = "已打开默认输出目录";
         }
+        #endregion
 
+        #region 按钮项
+        private void BtImport_Click(object sender, EventArgs e)
+        {
+            FolderBrowserDialog dialog = new FolderBrowserDialog();
+            dialog.Description = "请选择要导入的文件路径";
+            if (dialog.ShowDialog() == DialogResult.OK)
+            {
+                string foldPath = dialog.SelectedPath;
+                List<string> fileList = FileTool.GetAllFile(foldPath);
+                if (ListTool.HasElements(fileList))
+                {
+                    FileCodeTool fc = new FileCodeTool();
+                    fileList.ForEach(x =>
+                    {
+                        string relativePath = x.Replace(foldPath, "");
+                        DgFileList.Rows.Add(new object[] {
+                            relativePath, relativePath,fc.GetMD5(x), false });
+                    });
+                }
+            }
+        }
+        private void BtAddFile_Click(object sender, EventArgs e)
+        {
+            OpenFileDialog fileDialog = new OpenFileDialog();
+            if (fileDialog.ShowDialog() == DialogResult.OK)
+            {
+                FileCodeTool fc = new FileCodeTool();
+                DgFileList.Rows.Add(new object[] {
+                    fileDialog.FileName, fileDialog.FileName,
+                    fc.GetMD5(fileDialog.FileName),  false });
+            }
+        }
+        private void BtClear_Click(object sender, EventArgs e)
+        {
+            DgFileList.Rows.Clear();
+        }
+        #endregion
         private VersionModel GatherModel()
         {
             VersionModel rs = new VersionModel()
@@ -45,7 +156,6 @@ namespace Oreo.VersionBuilder.Views
                 VersionNumber = TbVersionNumber.Text.Trim(),
                 VersionDesc = TbVersionDesc.Text.Trim(),
                 ServerPath = TbServerPath.Text.Trim(),
-                IsPlugin = CbIsPlugin.Checked,
                 PluginName = TbPluginName.Text.Trim(),
                 PluginEntry = TbPluginEntry.Text.Trim(),
                 BeforeUpdateStartProcess = TbBeforeUpdateStartProcess.Text.Trim().Split(','),
@@ -53,55 +163,38 @@ namespace Oreo.VersionBuilder.Views
                 AfterUpdateStartProcess = TbAfterUpdateStartProcess.Text.Trim().Split(','),
                 AfterUpdateKillProcess = TbAfterUpdateKillProcess.Text.Trim().Split(','),
             };
+            if (DgFileList.Rows.Count > 0)
+            {
+                rs.FileList = new List<VersionFile>();
+                foreach (DataGridViewRow row in DgFileList.Rows)
+                {
+                    rs.FileList.Add(new VersionFile()
+                    {
+                        ServerFile = row.Cells["ClFileListServer"].Value.ToString(),
+                        LocalFile = row.Cells["ClFileListLocal"].Value.ToString(),
+                        FileMD5 = row.Cells["ClFileListMD5"].Value.ToString(),
+                        IsClean = (bool)row.Cells["ClFileListClean"].Value,
+                    });
+                }
+            }
             return rs;
         }
-
-        private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
+        private void Clear()
         {
+            NowOpenFile = "";
             TbCodeName.Text = "";
             TbVersionNumber.Text = "";
             TbVersionDesc.Text = "";
             TbServerPath.Text = "";
-            CbIsPlugin.Checked = false;
             TbPluginName.Text = "";
             TbPluginEntry.Text = "";
             TbBeforeUpdateStartProcess.Text = "";
             TbBeforeUpdateKillProcess.Text = "";
             TbAfterUpdateStartProcess.Text = "";
             TbAfterUpdateKillProcess.Text = "";
+            DgFileList.Rows.Clear();
         }
 
-        private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog fileDialog = new OpenFileDialog();
-            fileDialog.Filter = "版本文件|*.version|文本文档|*.txt";
-            if (fileDialog.ShowDialog() == DialogResult.OK)
-            {
-                string file = fileDialog.FileName;
-                if (!string.IsNullOrWhiteSpace(file))
-                {
-                    VersionModel vm = JsonTool.ToObjFromFile<VersionModel>(file);
-                    if (vm != null)
-                    {
-                        TbCodeName.Text = vm.CodeName;
-                        TbVersionNumber.Text = vm.VersionNumber;
-                        TbVersionDesc.Text = vm.VersionDesc;
-                        TbServerPath.Text = vm.ServerPath;
-                        CbIsPlugin.Checked = vm.IsPlugin;
-                        TbPluginName.Text = vm.PluginName;
-                        TbPluginEntry.Text = vm.PluginEntry;
-                        TbBeforeUpdateStartProcess.Text = string.Join(",", vm.BeforeUpdateStartProcess);
-                        TbBeforeUpdateKillProcess.Text = string.Join(",", vm.BeforeUpdateKillProcess.ToString());
-                        TbAfterUpdateStartProcess.Text = string.Join(",", vm.AfterUpdateStartProcess.ToString());
-                        TbAfterUpdateKillProcess.Text = string.Join(",", vm.AfterUpdateKillProcess.ToString());
-                    }
-                }
-            }
-        }
 
-        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            Close();
-        }
     }
 }

+ 4 - 4
Fork.Net/Oreo.VersionBuilder/Views/MainForm.resx

@@ -117,16 +117,16 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="ClServer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ClFileListServer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="ClLocal.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ClFileListLocal.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="ClUpdate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ClFileListMD5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="ClDelete.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ClFileListClean.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="MsMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

+ 23 - 0
Fork.Net/Oreo.VersionUpdate/Commons/P.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Y.Utils.IOUtils.LogUtils;
+
+namespace Oreo.VersionUpdate.Commons
+{
+    public static class P
+    {
+        public static void Init()
+        {
+            InitLog();
+        }
+
+        static void InitLog()
+        { 
+            R.Log.SetWriteFile(true, "Oreo.CleverDog.Log");
+            R.Log.LogLevel = LogLevel.All;
+        }
+    }
+}

+ 24 - 0
Fork.Net/Oreo.VersionUpdate/Commons/R.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Y.Utils.IOUtils.LogUtils;
+
+namespace Oreo.VersionUpdate.Commons
+{
+    public class R
+    {
+        public static Log Log = new Log();
+
+        public static class Settings
+        {
+            public static class FTP
+            {
+                public static string Address = "ftp://192.168.3.56";
+                public static string Account = "Administrator";
+                public static string Password = "yuzhengyang";
+            }
+        }
+    }
+}

+ 0 - 39
Fork.Net/Oreo.VersionUpdate/Form1.Designer.cs

@@ -1,39 +0,0 @@
-namespace Oreo.VersionUpdate
-{
-    partial class Form1
-    {
-        /// <summary>
-        /// 必需的设计器变量。
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// 清理所有正在使用的资源。
-        /// </summary>
-        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows 窗体设计器生成的代码
-
-        /// <summary>
-        /// 设计器支持所需的方法 - 不要修改
-        /// 使用代码编辑器修改此方法的内容。
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.components = new System.ComponentModel.Container();
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Text = "Form1";
-        }
-
-        #endregion
-    }
-}
-

+ 0 - 20
Fork.Net/Oreo.VersionUpdate/Form1.cs

@@ -1,20 +0,0 @@
-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 Oreo.VersionUpdate
-{
-    public partial class Form1 : Form
-    {
-        public Form1()
-        {
-            InitializeComponent();
-        }
-    }
-}

+ 14 - 0
Fork.Net/Oreo.VersionUpdate/Models/PluginModel.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Oreo.VersionUpdate.Models
+{
+    public class PluginModel
+    {
+        public string Name { get; set; }
+        public string Version { get; set; }
+    }
+}

+ 12 - 14
Fork.Net/Oreo.VersionUpdate/Models/VersionModel.cs

@@ -1,4 +1,6 @@
-namespace Oreo.VersionUpdate.Models
+using System.Collections.Generic;
+
+namespace Oreo.VersionUpdate.Models
 {
     public class VersionModel
     {
@@ -19,29 +21,25 @@
         /// </summary>
         public string ServerPath { get; set; }
         /// <summary>
-        /// 更新前 关闭进程
-        /// </summary>
-        public string[] BeforeUpdateKillProcess { get; set; }
-        /// <summary>
         /// 更新前 启动进程
         /// </summary>
         public string[] BeforeUpdateStartProcess { get; set; }
         /// <summary>
-        /// 更新 关闭进程
+        /// 更新 关闭进程
         /// </summary>
-        public string[] AfterUpdateKillProcess { get; set; }
+        public string[] BeforeUpdateKillProcess { get; set; }
         /// <summary>
-        /// 更新后 启动金城
+        /// 更新后 启动进程
         /// </summary>
         public string[] AfterUpdateStartProcess { get; set; }
         /// <summary>
-        /// 文件列表
+        /// 更新后 关闭进程
         /// </summary>
-        public VersionFile[] FileList { get; set; }
+        public string[] AfterUpdateKillProcess { get; set; }
         /// <summary>
-        /// 属于插件(用于更新插件清单)
+        /// 文件列表
         /// </summary>
-        public bool IsPlugin { get; set; }
+        public List<VersionFile> FileList { get; set; }
         /// <summary>
         /// 插件名称
         /// </summary>
@@ -66,8 +64,8 @@
         /// </summary>
         public string FileMD5 { get; set; }
         /// <summary>
-        /// 删除文件(用于清理冗余)
+        /// 清理文件(用于清理冗余)
         /// </summary>
-        public bool Delete { get; set; }
+        public bool IsClean { get; set; }
     }
 }

+ 22 - 6
Fork.Net/Oreo.VersionUpdate/Oreo.VersionUpdate.csproj

@@ -33,6 +33,9 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Newtonsoft.Json">
+      <HintPath>..\Dlls\Fork.Net\Newtonsoft.Json.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
@@ -44,17 +47,26 @@
     <Reference Include="System.Net.Http" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
+    <Reference Include="Y.Skin">
+      <HintPath>..\Dlls\Fork.Net\Y.Skin.dll</HintPath>
+    </Reference>
+    <Reference Include="Y.Utils">
+      <HintPath>..\Dlls\Fork.Net\Y.Utils.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Form1.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </Compile>
+    <Compile Include="Commons\P.cs" />
+    <Compile Include="Commons\R.cs" />
+    <Compile Include="Models\PluginModel.cs" />
     <Compile Include="Models\VersionModel.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Views\MainForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Views\MainForm.Designer.cs">
+      <DependentUpon>MainForm.cs</DependentUpon>
+    </Compile>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -64,6 +76,9 @@
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="Views\MainForm.resx">
+      <DependentUpon>MainForm.cs</DependentUpon>
+    </EmbeddedResource>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -77,6 +92,7 @@
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

+ 5 - 2
Fork.Net/Oreo.VersionUpdate/Program.cs

@@ -1,4 +1,6 @@
-using System;
+using Oreo.VersionUpdate.Commons;
+using Oreo.VersionUpdate.Views;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
@@ -14,9 +16,10 @@ namespace Oreo.VersionUpdate
         [STAThread]
         static void Main()
         {
+            P.Init();
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1());
+            Application.Run(new MainForm());
         }
     }
 }

+ 47 - 0
Fork.Net/Oreo.VersionUpdate/Views/MainForm.Designer.cs

@@ -0,0 +1,47 @@
+namespace Oreo.VersionUpdate.Views
+{
+    partial class MainForm
+    {
+        /// <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()
+        {
+            this.SuspendLayout();
+            // 
+            // MainForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(284, 261);
+            this.Name = "MainForm";
+            this.Text = "MainForm";
+            this.Load += new System.EventHandler(this.MainForm_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+    }
+}

+ 114 - 0
Fork.Net/Oreo.VersionUpdate/Views/MainForm.cs

@@ -0,0 +1,114 @@
+using Oreo.VersionUpdate.Commons;
+using Oreo.VersionUpdate.Models;
+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;
+using Y.Utils.DataUtils.Collections;
+
+namespace Oreo.VersionUpdate.Views
+{
+    public partial class MainForm : Form
+    {
+        public MainForm()
+        {
+            InitializeComponent();
+        }
+        private void MainForm_Load(object sender, EventArgs e)
+        {
+
+        }
+        private void StartUpdate()
+        {
+            Task.Factory.StartNew(() =>
+            {
+                //读取标准更新最新版本号 获取需要标准更新的配置
+                StartUpdateStandard();
+
+                //使用本地插件名称和版本号 获取需要更新插件的配置
+                StartUpdatePlugin();
+            });
+        }
+        private void StartUpdateStandard()
+        {
+            R.Log.i("读取标准更新版本号");
+            string versionNumber = GetStandardVersionNumber();
+        }
+        private void StartUpdatePlugin()
+        {
+            R.Log.i("读取本地插件列表(名称、版本号)");
+            List<PluginModel> pluginList = GetPluginList();
+            if (ListTool.HasElements(pluginList))
+            {
+                R.Log.i("共读取到 " + pluginList.Count + " 个插件");
+                pluginList.ForEach(x =>
+                {
+                    R.Log.i("请求 " + x.Name + " / " + x.Version + " 插件的更新");
+                    VersionModel pluginNewVersion = GetPluginNewVersion(x);
+                    if (pluginNewVersion != null)
+                    {
+                        R.Log.i(x.Name + " / " + x.Version + " 插件有新版本 " + pluginNewVersion.VersionNumber + " 需要更新,准备更新");
+                        bool flag = Update(pluginNewVersion);
+                        if (flag)
+                        {
+                            R.Log.i(x.Name + " 更新成功,当前版本" + pluginNewVersion.VersionNumber);
+                        }
+                        else
+                        {
+                            R.Log.w(x.Name + " 更新失败");
+                        }
+                    }
+                });
+            }
+            else
+            {
+                R.Log.w("本地插件列表为空");
+            }
+            R.Log.i("本地插件更新操作结束");
+        }
+        #region 读取本地数据操作
+        private List<PluginModel> GetPluginList()
+        {
+            List<PluginModel> rs = null;
+            return rs;
+        }
+        private string GetStandardVersionNumber()
+        {
+            string rs = "";
+            return rs;
+        }
+        #endregion
+        #region 读取网络数据操作
+        private VersionModel GetPluginNewVersion(PluginModel pm)
+        {
+            VersionModel rs = null;
+            return rs;
+        }
+        #endregion
+        #region 更新操作
+        private bool Update(VersionModel vm)
+        {
+            return false;
+        }
+        #endregion
+        #region UI操作
+        /// <summary>
+        /// 退出程序
+        /// </summary>
+        void UIClose()
+        {
+            Invoke(new Action(() =>
+            {
+                Close();
+            }));
+        }
+        #endregion
+
+
+    }
+}

+ 120 - 0
Fork.Net/Oreo.VersionUpdate/Views/MainForm.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>