📄 manifestutilitymainform.cs
字号:
//===========================================================================
// 引用到FPMS项目中,只是做了界面的汉化处理和格局的部分调整
// 版权信息参考下面的信息。
//
//=============================================================================
//============================================================================================================
// Microsoft Updater Application Block for .NET
// http://msdn.microsoft.com/library/en-us/dnbda/html/updater.asp
//
// ManifestUtilityMainForm.cs
//
//============================================================================================================
// Copyright (C) 2000-2001 Microsoft Corporation
// All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
// FITNESS FOR A PARTICULAR PURPOSE.
//============================================================================================================
// define this compiler directive IF YOU ARE USING FRAMEWORK VERSION 1.1:
// FX 1.0 does not support the FolderBrowserDialog component, so we must manually enter the
// physical folder path to look for updates. By defining this directive, we tell compiler
// OK to use folder-browser component in 1.1
// **** IF YOU ARE USING FRAMEWORK 1.0 ONLY, then comment the following line:
#define FRAMEWORK_1_1
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Reflection;
using System.IO;
using System.Xml;
using System.Threading;
using System.Text;
using Microsoft.ApplicationBlocks.ApplicationUpdater.Interfaces;
namespace ManifestUtility
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class ManifestUtilityMainForm : System.Windows.Forms.Form
{
#region declarations
private System.Windows.Forms.Label folderLbl;
private System.Windows.Forms.TextBox folderPath;
private System.Windows.Forms.Button browseForFolder;
private System.Windows.Forms.Label updateLocationLbl;
private System.Windows.Forms.TextBox updateLocation;
private System.Windows.Forms.Label versionLbl;
private System.Windows.Forms.TextBox version;
private System.Windows.Forms.TextBox key;
private System.Windows.Forms.Label keyLbl;
private System.Windows.Forms.Button browseForKey;
private System.Windows.Forms.Label validatorAssemblyLbl;
private System.Windows.Forms.TextBox validatorAssembly;
private System.Windows.Forms.Button browseForValidatorAssembly;
private System.Windows.Forms.Label validatorClassLbl;
private System.Windows.Forms.ComboBox validatorClass;
private System.Windows.Forms.Label postProcessorAssemblyLbl;
private System.Windows.Forms.CheckBox usePostProcessor;
private System.Windows.Forms.TextBox postProcessorAssembly;
private System.Windows.Forms.Button browseForPostProcessor;
private System.Windows.Forms.ComboBox postProcessorClass;
private System.Windows.Forms.Label postProcessorClassLbl;
private System.Windows.Forms.Button createManifest;
// can only use this object w/ FX1.1
#if FRAMEWORK_1_1
private System.Windows.Forms.FolderBrowserDialog folderDialog;
#endif
private System.Windows.Forms.OpenFileDialog validatorDialog;
private System.Windows.Forms.OpenFileDialog postProcessorDialog;
private System.Windows.Forms.SaveFileDialog manifestDialog;
private System.Windows.Forms.OpenFileDialog keyDialog;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.SaveFileDialog newKeyDialog;
private System.Windows.Forms.MenuItem fileMenu;
private System.Windows.Forms.MenuItem fileCreateManifestMenu;
private System.Windows.Forms.MenuItem fileGenerateKeysMenu;
private System.Windows.Forms.MenuItem fileExitMenu;
private System.Windows.Forms.ToolTip toolTip1;
private System.ComponentModel.IContainer components;
#endregion
#region Standard Form Stuff
public ManifestUtilityMainForm()
{
InitializeComponent();
SetToolTips();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (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.components = new System.ComponentModel.Container();
this.folderLbl = new System.Windows.Forms.Label();
this.folderPath = new System.Windows.Forms.TextBox();
this.browseForFolder = new System.Windows.Forms.Button();
this.updateLocationLbl = new System.Windows.Forms.Label();
this.updateLocation = new System.Windows.Forms.TextBox();
this.versionLbl = new System.Windows.Forms.Label();
this.version = new System.Windows.Forms.TextBox();
this.key = new System.Windows.Forms.TextBox();
this.keyLbl = new System.Windows.Forms.Label();
this.browseForKey = new System.Windows.Forms.Button();
this.validatorAssemblyLbl = new System.Windows.Forms.Label();
this.validatorAssembly = new System.Windows.Forms.TextBox();
this.browseForValidatorAssembly = new System.Windows.Forms.Button();
this.validatorClassLbl = new System.Windows.Forms.Label();
this.validatorClass = new System.Windows.Forms.ComboBox();
this.postProcessorAssemblyLbl = new System.Windows.Forms.Label();
this.usePostProcessor = new System.Windows.Forms.CheckBox();
this.postProcessorAssembly = new System.Windows.Forms.TextBox();
this.browseForPostProcessor = new System.Windows.Forms.Button();
this.postProcessorClass = new System.Windows.Forms.ComboBox();
this.postProcessorClassLbl = new System.Windows.Forms.Label();
this.createManifest = new System.Windows.Forms.Button();
this.folderDialog = new System.Windows.Forms.FolderBrowserDialog();
this.validatorDialog = new System.Windows.Forms.OpenFileDialog();
this.postProcessorDialog = new System.Windows.Forms.OpenFileDialog();
this.manifestDialog = new System.Windows.Forms.SaveFileDialog();
this.keyDialog = new System.Windows.Forms.OpenFileDialog();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.fileMenu = new System.Windows.Forms.MenuItem();
this.fileCreateManifestMenu = new System.Windows.Forms.MenuItem();
this.fileGenerateKeysMenu = new System.Windows.Forms.MenuItem();
this.fileExitMenu = new System.Windows.Forms.MenuItem();
this.newKeyDialog = new System.Windows.Forms.SaveFileDialog();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout();
//
// folderLbl
//
this.folderLbl.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.folderLbl.Location = new System.Drawing.Point(19, 16);
this.folderLbl.Name = "folderLbl";
this.folderLbl.Size = new System.Drawing.Size(135, 17);
this.folderLbl.TabIndex = 0;
this.folderLbl.Text = "更新文件路径:";
//
// folderPath
//
this.folderPath.Font = new System.Drawing.Font("Century Gothic", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.folderPath.Location = new System.Drawing.Point(163, 17);
this.folderPath.Name = "folderPath";
this.folderPath.ReadOnly = true;
this.folderPath.Size = new System.Drawing.Size(538, 21);
this.folderPath.TabIndex = 1;
this.folderPath.Text = "C:\\";
//
// browseForFolder
//
this.browseForFolder.BackColor = System.Drawing.Color.Gold;
this.browseForFolder.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.browseForFolder.Location = new System.Drawing.Point(710, 17);
this.browseForFolder.Name = "browseForFolder";
this.browseForFolder.Size = new System.Drawing.Size(29, 25);
this.browseForFolder.TabIndex = 2;
this.browseForFolder.Text = "...";
this.browseForFolder.Click += new System.EventHandler(this.browseForFolder_Click);
//
// updateLocationLbl
//
this.updateLocationLbl.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.updateLocationLbl.Location = new System.Drawing.Point(19, 48);
this.updateLocationLbl.Name = "updateLocationLbl";
this.updateLocationLbl.Size = new System.Drawing.Size(135, 25);
this.updateLocationLbl.TabIndex = 3;
this.updateLocationLbl.Text = "服务器虚拟路径:";
//
// updateLocation
//
this.updateLocation.Font = new System.Drawing.Font("Century Gothic", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.updateLocation.Location = new System.Drawing.Point(163, 52);
this.updateLocation.Name = "updateLocation";
this.updateLocation.Size = new System.Drawing.Size(538, 21);
this.updateLocation.TabIndex = 4;
this.updateLocation.Text = "http://localhost/appupdater";
//
// versionLbl
//
this.versionLbl.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.versionLbl.Location = new System.Drawing.Point(19, 88);
this.versionLbl.Name = "versionLbl";
this.versionLbl.Size = new System.Drawing.Size(135, 25);
this.versionLbl.TabIndex = 5;
this.versionLbl.Text = "版本号:";
//
// version
//
this.version.Font = new System.Drawing.Font("Century Gothic", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.version.Location = new System.Drawing.Point(163, 86);
this.version.Name = "version";
this.version.Size = new System.Drawing.Size(538, 21);
this.version.TabIndex = 6;
this.version.Text = "2.0.0.0";
//
// key
//
this.key.Font = new System.Drawing.Font("Century Gothic", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.key.Location = new System.Drawing.Point(163, 121);
this.key.Multiline = true;
this.key.Name = "key";
this.key.Size = new System.Drawing.Size(538, 103);
this.key.TabIndex = 7;
this.key.Text = "";
//
// keyLbl
//
this.keyLbl.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.keyLbl.Location = new System.Drawing.Point(19, 121);
this.keyLbl.Name = "keyLbl";
this.keyLbl.Size = new System.Drawing.Size(125, 24);
this.keyLbl.TabIndex = 8;
this.keyLbl.Text = "密匙:";
//
// browseForKey
//
this.browseForKey.BackColor = System.Drawing.Color.Gold;
this.browseForKey.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.browseForKey.Location = new System.Drawing.Point(710, 198);
this.browseForKey.Name = "browseForKey";
this.browseForKey.Size = new System.Drawing.Size(29, 25);
this.browseForKey.TabIndex = 9;
this.browseForKey.Text = "...";
this.browseForKey.Click += new System.EventHandler(this.browseForKey_Click);
//
// validatorAssemblyLbl
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -