Browse Source

自动更新完善。

master
yibo 8 years ago
parent
commit
55d5ea2625
24 changed files with 1112 additions and 53 deletions
  1. +1
    -0
      AutoUpdate/AutoUpdate.csproj
  2. +68
    -0
      AutoUpdate/ClientVersion.cs
  3. +61
    -3
      AutoUpdate/Update.Designer.cs
  4. +158
    -14
      AutoUpdate/Update.cs
  5. +6
    -0
      B3ButcherManageClient.sln
  6. +0
    -6
      BO/Utils/LoginRpcUtil.cs
  7. +22
    -1
      BO/Utils/XmlUtil.cs
  8. +13
    -14
      ButcherManageClient/Login.cs
  9. +10
    -9
      ButcherOrder/ButcherOrderForm.Designer.cs
  10. +22
    -5
      ButcherOrder/ButcherOrderForm.cs
  11. +1
    -1
      ButcherOrder/ButcherOrderForm.resx
  12. +6
    -0
      CreateUpdateXmlFile/App.config
  13. +47
    -0
      CreateUpdateXmlFile/ClientVersion.cs
  14. +89
    -0
      CreateUpdateXmlFile/CreateUpdateXmlFile.csproj
  15. +145
    -0
      CreateUpdateXmlFile/Form1.Designer.cs
  16. +57
    -0
      CreateUpdateXmlFile/Form1.cs
  17. +123
    -0
      CreateUpdateXmlFile/Form1.resx
  18. +22
    -0
      CreateUpdateXmlFile/Program.cs
  19. +36
    -0
      CreateUpdateXmlFile/Properties/AssemblyInfo.cs
  20. +71
    -0
      CreateUpdateXmlFile/Properties/Resources.Designer.cs
  21. +117
    -0
      CreateUpdateXmlFile/Properties/Resources.resx
  22. +30
    -0
      CreateUpdateXmlFile/Properties/Settings.Designer.cs
  23. +7
    -0
      CreateUpdateXmlFile/Properties/Settings.settings
  24. BIN
      Setup/Release/Setup.msi

+ 1
- 0
AutoUpdate/AutoUpdate.csproj View File

@ -44,6 +44,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ClientVersion.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Update.cs"> <Compile Include="Update.cs">


+ 68
- 0
AutoUpdate/ClientVersion.cs View File

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace AutoUpdate
{
public class ClientVersion
{
public string Version { get; set; }
public string ServerUrl { get; set; }
private List<UpdateFile> _update = new List<UpdateFile>();
public List<UpdateFile> UpdateFiles { get { return _update; } set { _update = value; } }
}
public class UpdateFile
{
public string FileName { get; set; }
public string Url { get; set; }
public int Size { get; set; }
public bool NeedRestart { get; set; }
}
public static class XmlUtil
{
public static T XmlDeserializeObject<T>(string xmlOfObject) where T : class
{
using (MemoryStream ms = new MemoryStream())
{
using (StreamWriter sr = new StreamWriter(ms, Encoding.UTF8))
{
sr.Write(xmlOfObject);
sr.Flush();
ms.Seek(0, SeekOrigin.Begin);
XmlSerializer serializer = new XmlSerializer(typeof(T));
return serializer.Deserialize(ms) as T;
}
}
}
public static T DeserializeFromFile<T>(string fileName = "")
{
if (string.IsNullOrWhiteSpace(fileName))
{
fileName = typeof(T).Name + ".xml";
}
if (!File.Exists(fileName))
{
throw new FileNotFoundException("不存在文件:" + fileName);
}
using (var reader = new StreamReader(fileName))
{
var xs = new XmlSerializer(typeof(T));
object obj = xs.Deserialize(reader);
reader.Close();
return (T)obj;
}
}
}
}

+ 61
- 3
AutoUpdate/Update.Designer.cs View File

@ -28,24 +28,82 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.progressBarTotal = new System.Windows.Forms.ProgressBar();
this.progressBarCurrent = new System.Windows.Forms.ProgressBar();
this.labelCurrentItem = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.labelCurrent = new System.Windows.Forms.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// progressBarTotal
//
this.progressBarTotal.Location = new System.Drawing.Point(28, 81);
this.progressBarTotal.Name = "progressBarTotal";
this.progressBarTotal.Size = new System.Drawing.Size(438, 12);
this.progressBarTotal.Step = 1;
this.progressBarTotal.TabIndex = 6;
//
// progressBarCurrent
//
this.progressBarCurrent.Location = new System.Drawing.Point(27, 42);
this.progressBarCurrent.Name = "progressBarCurrent";
this.progressBarCurrent.Size = new System.Drawing.Size(438, 12);
this.progressBarCurrent.Step = 1;
this.progressBarCurrent.TabIndex = 7;
//
// labelCurrentItem
//
this.labelCurrentItem.AutoSize = true;
this.labelCurrentItem.Location = new System.Drawing.Point(97, 27);
this.labelCurrentItem.Name = "labelCurrentItem";
this.labelCurrentItem.Size = new System.Drawing.Size(0, 12);
this.labelCurrentItem.TabIndex = 3;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(26, 66);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 12);
this.label1.TabIndex = 4;
this.label1.Text = "总进度:";
//
// labelCurrent
//
this.labelCurrent.AutoSize = true;
this.labelCurrent.Location = new System.Drawing.Point(26, 27);
this.labelCurrent.Name = "labelCurrent";
this.labelCurrent.Size = new System.Drawing.Size(65, 12);
this.labelCurrent.TabIndex = 5;
this.labelCurrent.Text = "正在下载:";
//
// Update // Update
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(580, 148);
this.ClientSize = new System.Drawing.Size(483, 134);
this.ControlBox = false;
this.Controls.Add(this.progressBarTotal);
this.Controls.Add(this.progressBarCurrent);
this.Controls.Add(this.labelCurrentItem);
this.Controls.Add(this.label1);
this.Controls.Add(this.labelCurrent);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Update"; this.Name = "Update";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "自动更新"; this.Text = "自动更新";
this.Load += new System.EventHandler(this.Update_Load); this.Load += new System.EventHandler(this.Update_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.ProgressBar progressBarTotal;
private System.Windows.Forms.ProgressBar progressBarCurrent;
private System.Windows.Forms.Label labelCurrentItem;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label labelCurrent;
} }
} }

+ 158
- 14
AutoUpdate/Update.cs View File

@ -8,6 +8,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
@ -15,29 +16,172 @@ namespace AutoUpdate
{ {
public partial class Update : Form public partial class Update : Form
{ {
string[] updateInfo;
const string serUri = "http://172.28.1.194:7799/AutoUpdate/ClientVersion.xml";
const string PuKey = "c756e02cedb42a33f78091a466411bde8447d854";
private bool isFinished = false;
private List<UpdateFile> downloadFileList = null;
private ManualResetEvent evtDownload = null;
private ManualResetEvent evtPerDonwload = null;
private WebClient clientDownload = null;
bool error = false;
public Update(string[] args) public Update(string[] args)
{ {
InitializeComponent(); InitializeComponent();
updateInfo = args;
if (args == null || args.Length == 0 || args[0] != PuKey)
error = true;
} }
private void Update_Load(object sender, EventArgs e) private void Update_Load(object sender, EventArgs e)
{ {
if (updateInfo != null && updateInfo.Length > 0)
if (error)
Application.Exit();
var versionFile = "ClientVersion.xml";
ClientVersion old = new ClientVersion();
if (File.Exists(versionFile))
old = XmlUtil.DeserializeFromFile<ClientVersion>(versionFile);
if (string.IsNullOrEmpty(old.ServerUrl))
old.ServerUrl = serUri;
clientDownload = new WebClient();
var version = XmlUtil.XmlDeserializeObject<ClientVersion>(clientDownload.DownloadString(old.ServerUrl));
downloadFileList = version.UpdateFiles;
evtDownload = new ManualResetEvent(true);
evtDownload.Reset();
Thread t = new Thread(new ThreadStart(ProcDownload));
t.Name = "download";
t.Start();
}
long total = 0;
long nDownloadedTotal = 0;
string startFile = "ButcherManageClient.exe";
string oldFolder;
private void ProcDownload()
{
evtPerDonwload = new ManualResetEvent(false);
foreach (var file in this.downloadFileList)
{
total += file.Size;
}
oldFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "old");
if (!Directory.Exists(oldFolder))
Directory.CreateDirectory(oldFolder);
while (!evtDownload.WaitOne(0, false))
{
if (this.downloadFileList.Count == 0)
break;
var file = this.downloadFileList[0];
if (file.NeedRestart)
startFile = file.FileName;
this.ShowCurrentDownloadFileName(file.FileName);
//下载
clientDownload = new WebClient();
clientDownload.DownloadProgressChanged += new DownloadProgressChangedEventHandler(OnDownloadProgressChanged);
clientDownload.DownloadFileCompleted += new AsyncCompletedEventHandler(OnDownloadFileCompleted);
evtPerDonwload.Reset();
clientDownload.DownloadFileAsync(new Uri(file.Url), Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file.FileName + ".tmp"), file);
//等待下载完成
evtPerDonwload.WaitOne();
clientDownload.Dispose();
clientDownload = null;
//移除已下载的文件
this.downloadFileList.Remove(file);
}
if (this.downloadFileList.Count == 0)
{
Exit(true);
evtDownload.Set();
Process.Start(Path.Combine(Application.StartupPath, startFile));
Application.Exit();
}
else
Exit(false);
evtDownload.Set();
}
void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
var file = e.UserState as UpdateFile;
nDownloadedTotal += file.Size;
this.SetProcessBar(0, (int)(nDownloadedTotal * 100 / total));
//备份文件
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file.FileName);
var oldFile = Path.Combine(oldFolder, file.FileName);
if (File.Exists(filePath))
{
if (File.Exists(oldFile))
File.Delete(oldFile);
File.Move(filePath, oldFile);
}
File.Move(filePath + ".tmp", filePath);
//继续下载其它文件
evtPerDonwload.Set();
}
void OnDownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
this.SetProcessBar(e.ProgressPercentage, (int)((nDownloadedTotal + e.BytesReceived) * 100 / total));
}
delegate void ShowCurrentDownloadFileNameCallBack(string name);
private void ShowCurrentDownloadFileName(string name)
{
if (this.labelCurrentItem.InvokeRequired)
{
ShowCurrentDownloadFileNameCallBack cb = new ShowCurrentDownloadFileNameCallBack(ShowCurrentDownloadFileName);
this.Invoke(cb, new object[] { name });
}
else
{
this.labelCurrentItem.Text = name;
}
}
delegate void SetProcessBarCallBack(int current, int total);
private void SetProcessBar(int current, int total)
{
if (this.progressBarCurrent.InvokeRequired)
{
SetProcessBarCallBack cb = new SetProcessBarCallBack(SetProcessBar);
this.Invoke(cb, new object[] { current, total });
}
else
{
this.progressBarCurrent.Value = current;
this.progressBarTotal.Value = total;
}
}
delegate void ExitCallBack(bool success);
private void Exit(bool success)
{
if (this.InvokeRequired)
{
ExitCallBack cb = new ExitCallBack(Exit);
this.Invoke(cb, new object[] { success });
}
else
{ {
var parameters = updateInfo[0].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
var serverUrl = parameters[0];
var files = parameters[1].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var file in files)
{
var path = serverUrl + file;
var clientDownload = new WebClient();
clientDownload.DownloadFileAsync(new Uri(path), file);
}
this.isFinished = success;
this.DialogResult = success ? DialogResult.OK : DialogResult.Cancel;
this.Close();
} }
Process.Start(Path.Combine(Application.StartupPath, "ButcherManageClient.exe"));
Application.Exit();
} }
} }
} }

+ 6
- 0
B3ButcherManageClient.sln View File

@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeighAndGrading", "WeighAnd
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoUpdate", "AutoUpdate\AutoUpdate.csproj", "{5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoUpdate", "AutoUpdate\AutoUpdate.csproj", "{5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateUpdateXmlFile", "CreateUpdateXmlFile\CreateUpdateXmlFile.csproj", "{57BB1A02-118A-443D-A38A-BB36B9A77F6A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -61,6 +63,10 @@ Global
{5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}.Release|Any CPU.Build.0 = Release|Any CPU {5751AEE3-83BD-4CBE-8E65-0727FEC0F6C4}.Release|Any CPU.Build.0 = Release|Any CPU
{57BB1A02-118A-443D-A38A-BB36B9A77F6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57BB1A02-118A-443D-A38A-BB36B9A77F6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57BB1A02-118A-443D-A38A-BB36B9A77F6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57BB1A02-118A-443D-A38A-BB36B9A77F6A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE


+ 0
- 6
BO/Utils/LoginRpcUtil.cs View File

@ -43,11 +43,5 @@ namespace BO.Utils
userInfo.Role = obj.Get<string>("Role"); userInfo.Role = obj.Get<string>("Role");
} }
} }
public static string CheckVersion(string version)
{
const string method = "/MainSystem/B3ClientService/Rpcs/VersionRpc/CheckVersion";
return RpcFacade.Call<string>(method, version);
}
} }
} }

+ 22
- 1
BO/Utils/XmlUtil.cs View File

@ -23,7 +23,6 @@ namespace BO.Utils
} }
} }
public static T DeserializeFromFile<T>(string fileName = "") public static T DeserializeFromFile<T>(string fileName = "")
{ {
if (string.IsNullOrWhiteSpace(fileName)) if (string.IsNullOrWhiteSpace(fileName))
@ -42,5 +41,27 @@ namespace BO.Utils
return (T)obj; return (T)obj;
} }
} }
public static T XmlDeserializeObject<T>(string xmlOfObject) where T : class
{
using (MemoryStream ms = new MemoryStream())
{
using (StreamWriter sr = new StreamWriter(ms, Encoding.UTF8))
{
sr.Write(xmlOfObject);
sr.Flush();
ms.Seek(0, SeekOrigin.Begin);
XmlSerializer serializer = new XmlSerializer(typeof(T));
return serializer.Deserialize(ms) as T;
}
}
}
}
public class ClientVersion
{
public string Version { get; set; }
public string ServerUrl { get; set; }
} }
} }

+ 13
- 14
ButcherManageClient/Login.cs View File

@ -99,31 +99,30 @@ namespace ButcherManageClient
pwdTxt.Text = keyBoard.Result; pwdTxt.Text = keyBoard.Result;
} }
const string serUri = "http://172.28.1.194:7799/AutoUpdate/ClientVersion.xml";
const string puKey = "c756e02cedb42a33f78091a466411bde8447d854";
private void AutoUpdate() private void AutoUpdate()
{ {
if (!File.Exists("AutoUpdate.exe")) if (!File.Exists("AutoUpdate.exe"))
return; return;
var version = string.Empty;
if (File.Exists("Version.txt"))
{
version = File.ReadAllText("Version.txt");
}
IniteRpcFacade();
var files = LoginRpcUtil.CheckVersion(version);
if (string.IsNullOrEmpty(files))
var versionInfo = new ClientVersion();
if (File.Exists("ClientVersion.xml"))
versionInfo = XmlUtil.DeserializeFromFile<ClientVersion>();
if (string.IsNullOrEmpty(versionInfo.ServerUrl))
versionInfo.ServerUrl = serUri;
var down = new System.Net.WebClient();
var serverVersion = XmlUtil.XmlDeserializeObject<ClientVersion>(down.DownloadString(versionInfo.ServerUrl));
if (versionInfo.Version == serverVersion.Version)
return; return;
var serverUrl = ButcherAppContext.Context.UrlConfig.ServerUrl.Replace("Rest.aspx", "");
if (!serverUrl.EndsWith("/"))
serverUrl += "/";
serverUrl += "ClientVersion/";
System.Diagnostics.Process.Start(Path.Combine(Application.StartupPath, "AutoUpdate.exe"), serverUrl + "|" + files);
System.Diagnostics.Process.Start(Path.Combine(Application.StartupPath, "AutoUpdate.exe"), puKey);
Application.Exit(); Application.Exit();
} }
private void Login_Load(object sender, EventArgs e) private void Login_Load(object sender, EventArgs e)
{ {
//AutoUpdate();
AutoUpdate();
} }
} }
} }

+ 10
- 9
ButcherOrder/ButcherOrderForm.Designer.cs View File

@ -48,7 +48,7 @@
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IsOk = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.IsOk = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Ordre = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Order = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.HotFadeNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.HotFadeNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.updateBtn = new System.Windows.Forms.DataGridViewButtonColumn(); this.updateBtn = new System.Windows.Forms.DataGridViewButtonColumn();
@ -175,7 +175,7 @@
this.ID, this.ID,
this.OrderDetail_ID, this.OrderDetail_ID,
this.IsOk, this.IsOk,
this.Ordre,
this.Order,
this.PlanNumber, this.PlanNumber,
this.HotFadeNumber, this.HotFadeNumber,
this.updateBtn, this.updateBtn,
@ -193,6 +193,7 @@
this.secondOrderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.secondOrderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.secondOrderGridView.Size = new System.Drawing.Size(513, 569); this.secondOrderGridView.Size = new System.Drawing.Size(513, 569);
this.secondOrderGridView.TabIndex = 12; this.secondOrderGridView.TabIndex = 12;
this.secondOrderGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.secondOrderGridView_CellClick);
this.secondOrderGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.secondOrderGridView_CellContentClick); this.secondOrderGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.secondOrderGridView_CellContentClick);
// //
// uDatePicker1 // uDatePicker1
@ -233,13 +234,13 @@
this.IsOk.ReadOnly = true; this.IsOk.ReadOnly = true;
this.IsOk.Visible = false; this.IsOk.Visible = false;
// //
// Ordre
// Order
// //
this.Ordre.DataPropertyName = "Order";
this.Ordre.HeaderText = "顺序号";
this.Ordre.Name = "Ordre";
this.Ordre.ReadOnly = true;
this.Ordre.Width = 110;
this.Order.DataPropertyName = "Order";
this.Order.HeaderText = "顺序号";
this.Order.Name = "Order";
this.Order.ReadOnly = true;
this.Order.Width = 110;
// //
// PlanNumber // PlanNumber
// //
@ -322,7 +323,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn ID; private System.Windows.Forms.DataGridViewTextBoxColumn ID;
private System.Windows.Forms.DataGridViewTextBoxColumn OrderDetail_ID; private System.Windows.Forms.DataGridViewTextBoxColumn OrderDetail_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn IsOk; private System.Windows.Forms.DataGridViewTextBoxColumn IsOk;
private System.Windows.Forms.DataGridViewTextBoxColumn Ordre;
private System.Windows.Forms.DataGridViewTextBoxColumn Order;
private System.Windows.Forms.DataGridViewTextBoxColumn PlanNumber; private System.Windows.Forms.DataGridViewTextBoxColumn PlanNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn HotFadeNumber; private System.Windows.Forms.DataGridViewTextBoxColumn HotFadeNumber;
private System.Windows.Forms.DataGridViewButtonColumn updateBtn; private System.Windows.Forms.DataGridViewButtonColumn updateBtn;


+ 22
- 5
ButcherOrder/ButcherOrderForm.cs View File

@ -82,6 +82,7 @@ namespace ButcherOrder
BindGrid(); BindGrid();
} }
int? lastSelectOrder = null;
void BindGrid() void BindGrid()
{ {
secondOrderGridView.DataSource = orderList.OrderBy(x => x.Order).OrderBy(x => x.IsOk).ToList(); secondOrderGridView.DataSource = orderList.OrderBy(x => x.Order).OrderBy(x => x.IsOk).ToList();
@ -89,6 +90,10 @@ namespace ButcherOrder
{ {
if ((bool)row.Cells["IsOk"].Value) if ((bool)row.Cells["IsOk"].Value)
row.DefaultCellStyle.BackColor = Color.YellowGreen; row.DefaultCellStyle.BackColor = Color.YellowGreen;
if (lastSelectOrder.HasValue && lastSelectOrder == (int?)row.Cells["Order"].Value)
{
row.Selected = true;
}
} }
if (secondOrderGridView.CurrentRow != null) if (secondOrderGridView.CurrentRow != null)
{ {
@ -101,6 +106,10 @@ namespace ButcherOrder
orderLabel.Text = "0"; orderLabel.Text = "0";
InitScrollBar1(); InitScrollBar1();
secondOrderGridView.Refresh(); secondOrderGridView.Refresh();
if (roll != -1)
{
secondOrderGridView.FirstDisplayedScrollingRowIndex = roll;// secondOrderGridView.Rows[roll].Index;
}
} }
private void okBtn_Click(object sender, EventArgs e) private void okBtn_Click(object sender, EventArgs e)
@ -112,7 +121,7 @@ namespace ButcherOrder
var entity = secondOrderGridView.CurrentRow.DataBoundItem as SecondOrder; var entity = secondOrderGridView.CurrentRow.DataBoundItem as SecondOrder;
if (entity.IsOk) if (entity.IsOk)
{ {
var result = MessageBox.Show("当前行已更新\n确定要继续修改吗?","确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
var result = MessageBox.Show("当前行已更新\n确定要继续修改吗?", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
if (result != DialogResult.OK) if (result != DialogResult.OK)
return; return;
} }
@ -140,8 +149,6 @@ namespace ButcherOrder
if (e.RowIndex == -1) if (e.RowIndex == -1)
return; return;
var entity = secondOrderGridView.CurrentRow.DataBoundItem as SecondOrder; var entity = secondOrderGridView.CurrentRow.DataBoundItem as SecondOrder;
BindSelectColor(entity);
if (e.ColumnIndex < secondOrderGridView.ColumnCount - 2) if (e.ColumnIndex < secondOrderGridView.ColumnCount - 2)
return; return;
@ -163,6 +170,7 @@ namespace ButcherOrder
} }
} }
int roll = -1;
private void InitScrollBar1() private void InitScrollBar1()
{ {
vScrollBar1.Maximum = (secondOrderGridView.RowCount - secondOrderGridView.DisplayedRowCount(false) + 30) * secondOrderGridView.RowTemplate.Height; vScrollBar1.Maximum = (secondOrderGridView.RowCount - secondOrderGridView.DisplayedRowCount(false) + 30) * secondOrderGridView.RowTemplate.Height;
@ -171,9 +179,18 @@ namespace ButcherOrder
vScrollBar1.LargeChange = secondOrderGridView.RowTemplate.Height * 30; vScrollBar1.LargeChange = secondOrderGridView.RowTemplate.Height * 30;
this.vScrollBar1.Scroll += (sender, e) => this.vScrollBar1.Scroll += (sender, e) =>
{ {
secondOrderGridView.FirstDisplayedScrollingRowIndex = e.NewValue / secondOrderGridView.RowTemplate.Height;
Application.DoEvents();
roll = e.NewValue / secondOrderGridView.RowTemplate.Height;
secondOrderGridView.FirstDisplayedScrollingRowIndex = roll;
}; };
} }
private void secondOrderGridView_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1)
return;
var entity = secondOrderGridView.CurrentRow.DataBoundItem as SecondOrder;
lastSelectOrder = entity.Order;
BindSelectColor(entity);
}
} }
} }

+ 1
- 1
ButcherOrder/ButcherOrderForm.resx View File

@ -126,7 +126,7 @@
<metadata name="IsOk.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="IsOk.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Ordre.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="Order.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="PlanNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="PlanNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">


+ 6
- 0
CreateUpdateXmlFile/App.config View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

+ 47
- 0
CreateUpdateXmlFile/ClientVersion.cs View File

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace CreateUpdateXmlFile
{
public class ClientVersion
{
public string Version { get; set; }
public string ServerUrl { get; set; }
private List<UpdateFile> _update = new List<UpdateFile>();
public List<UpdateFile> UpdateFiles { get { return _update; } set { _update = value; } }
}
public class UpdateFile
{
public string FileName { get; set; }
public string Url { get; set; }
public int Size { get; set; }
public bool NeedRestart { get; set; }
}
public static class XmlUtil
{
public static void SerializerObjToFile(object obj, string fileName = "")
{
if (string.IsNullOrWhiteSpace(fileName))
{
fileName = obj.GetType().Name + ".xml";
}
var ser = new XmlSerializer(obj.GetType());
using (var stream = File.Open(fileName, FileMode.Create))
{
ser.Serialize(stream, obj);
}
}
}
}

+ 89
- 0
CreateUpdateXmlFile/CreateUpdateXmlFile.csproj View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{57BB1A02-118A-443D-A38A-BB36B9A77F6A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CreateUpdateXmlFile</RootNamespace>
<AssemblyName>CreateUpdateXmlFile</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClientVersion.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

+ 145
- 0
CreateUpdateXmlFile/Form1.Designer.cs View File

@ -0,0 +1,145 @@
namespace CreateUpdateXmlFile
{
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.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.create = new System.Windows.Forms.Button();
this.view = new System.Windows.Forms.Button();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("宋体", 12F);
this.textBox1.Location = new System.Drawing.Point(97, 98);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(408, 59);
this.textBox1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(26, 98);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 1;
this.label1.Text = "目录选择:";
//
// create
//
this.create.Location = new System.Drawing.Point(296, 178);
this.create.Name = "create";
this.create.Size = new System.Drawing.Size(93, 38);
this.create.TabIndex = 2;
this.create.Text = "生成";
this.create.UseVisualStyleBackColor = true;
this.create.Click += new System.EventHandler(this.create_Click);
//
// view
//
this.view.Location = new System.Drawing.Point(126, 178);
this.view.Name = "view";
this.view.Size = new System.Drawing.Size(93, 38);
this.view.TabIndex = 3;
this.view.Text = "浏览";
this.view.UseVisualStyleBackColor = true;
this.view.Click += new System.EventHandler(this.view_Click);
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(115, 67);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(390, 21);
this.textBox2.TabIndex = 4;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(26, 70);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(77, 12);
this.label2.TabIndex = 5;
this.label2.Text = "服务器地址:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(26, 27);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(53, 12);
this.label3.TabIndex = 6;
this.label3.Text = "主程序:";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(115, 24);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(285, 21);
this.textBox3.TabIndex = 7;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(545, 261);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.view);
this.Controls.Add(this.create);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button create;
private System.Windows.Forms.Button view;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox3;
}
}

+ 57
- 0
CreateUpdateXmlFile/Form1.cs View File

@ -0,0 +1,57 @@
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 System.IO;
namespace CreateUpdateXmlFile
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.textBox2.Text = "http://172.28.1.194:7799/AutoUpdate/";
this.textBox3.Text = "ButcherManageClient.exe";
}
private void view_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
this.textBox1.Text = folderBrowserDialog1.SelectedPath;
}
private void create_Click(object sender, EventArgs e)
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
{
MessageBox.Show("请完善信息");
return;
}
var entity = new ClientVersion();
entity.ServerUrl = textBox2.Text + "ClientVersion.xml";
entity.Version = DateTime.Now.ToString("yyyyMMddHHmm");
var folder = new DirectoryInfo(textBox1.Text);
foreach (var file in folder.GetFiles())
{
if (file.Name == "AutoUpdate.exe")
continue;
if (file.Extension == ".xml" && file.Name != "ClientVersion.xml")
continue;
var detail = new UpdateFile();
detail.FileName = file.Name;
detail.NeedRestart = textBox3.Text == detail.FileName;
detail.Size = (int)file.Length;
detail.Url = textBox2.Text + detail.FileName;
entity.UpdateFiles.Add(detail);
}
XmlUtil.SerializerObjToFile(entity);
MessageBox.Show("OK");
}
}
}

+ 123
- 0
CreateUpdateXmlFile/Form1.resx View File

@ -0,0 +1,123 @@
<?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>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

+ 22
- 0
CreateUpdateXmlFile/Program.cs View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CreateUpdateXmlFile
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

+ 36
- 0
CreateUpdateXmlFile/Properties/AssemblyInfo.cs View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CreateUpdateXmlFile")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CreateUpdateXmlFile")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9502ffc3-cd87-4eea-adbe-6bac36ca04f8")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71
- 0
CreateUpdateXmlFile/Properties/Resources.Designer.cs View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace CreateUpdateXmlFile.Properties
{
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的、缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CreateUpdateXmlFile.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
/// 方法是使用此强类型资源类。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

+ 117
- 0
CreateUpdateXmlFile/Properties/Resources.resx View File

@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

+ 30
- 0
CreateUpdateXmlFile/Properties/Settings.Designer.cs View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CreateUpdateXmlFile.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

+ 7
- 0
CreateUpdateXmlFile/Properties/Settings.settings View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

BIN
Setup/Release/Setup.msi View File


Loading…
Cancel
Save