📄 managerform.cs
字号:
}
UpdateActionBox();
if (selectedAction == action && runActionButton.Visible && runActionButton.Enabled)
runActionButton.PerformClick();
}
public void TryUninstall(AddIn addIn)
{
foreach (AddInControl ctl in splitContainer.Panel1.Controls) {
ctl.Selected = ctl.AddIn == addIn;
}
UpdateActionBox();
if (uninstallButton.Visible && uninstallButton.Enabled)
uninstallButton.PerformClick();
}
void RunActionButtonClick(object sender, EventArgs e)
{
switch (selectedAction) {
case AddInAction.Disable:
for (int i = 0; i < selected.Count; i++) {
if (selected[i].Manifest.PrimaryIdentity == "ICSharpCode.AddInManager") {
MessageService.ShowMessage("You cannot disable the AddInManager because you need it to re-enable AddIns!");
selected.RemoveAt(i--);
}
}
ICSharpCode.Core.AddInManager.Disable(selected);
break;
case AddInAction.Enable:
ICSharpCode.Core.AddInManager.Enable(selected);
break;
case AddInAction.Install:
RunInstallation();
return;
case AddInAction.Uninstall:
UninstallButtonClick(sender, e);
return;
case AddInAction.InstalledTwice: // used to cancel installation of update
InstallableAddIn.CancelUpdate(selected);
foreach (AddIn addIn in selected) {
addIn.Action = addIn.Enabled ? AddInAction.Enable : AddInAction.Disable;
}
break;
default:
throw new NotImplementedException();
}
foreach (AddInControl ctl in splitContainer.Panel1.Controls) {
ctl.Invalidate();
}
UpdateActionBox();
}
#region Windows Forms Designer generated code
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.topPanel = new System.Windows.Forms.Panel();
this.bottomPanel = new System.Windows.Forms.Panel();
this.installButton = new System.Windows.Forms.Button();
this.closeButton = new System.Windows.Forms.Button();
this.showPreinstalledAddInsCheckBox = new System.Windows.Forms.CheckBox();
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.actionGroupBox = new System.Windows.Forms.GroupBox();
this.actionFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.actionDescription = new System.Windows.Forms.Label();
this.dependencyTable = new System.Windows.Forms.TableLayoutPanel();
this.dummyLabel1 = new System.Windows.Forms.Label();
this.dummyLabel2 = new System.Windows.Forms.Label();
this.runActionButton = new System.Windows.Forms.Button();
this.uninstallButton = new System.Windows.Forms.Button();
this.bottomPanel.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout();
this.actionGroupBox.SuspendLayout();
this.actionFlowLayoutPanel.SuspendLayout();
this.dependencyTable.SuspendLayout();
this.SuspendLayout();
//
// topPanel
//
this.topPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.topPanel.Location = new System.Drawing.Point(0, 0);
this.topPanel.Name = "topPanel";
this.topPanel.Size = new System.Drawing.Size(460, 33);
this.topPanel.TabIndex = 1;
this.topPanel.Visible = false;
//
// bottomPanel
//
this.bottomPanel.Controls.Add(this.installButton);
this.bottomPanel.Controls.Add(this.closeButton);
this.bottomPanel.Controls.Add(this.showPreinstalledAddInsCheckBox);
this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.bottomPanel.Location = new System.Drawing.Point(0, 355);
this.bottomPanel.Name = "bottomPanel";
this.bottomPanel.Size = new System.Drawing.Size(460, 35);
this.bottomPanel.TabIndex = 0;
//
// installButton
//
this.installButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.installButton.Location = new System.Drawing.Point(274, 6);
this.installButton.Name = "installButton";
this.installButton.Size = new System.Drawing.Size(93, 23);
this.installButton.TabIndex = 1;
this.installButton.Text = "Install AddIn";
this.installButton.UseCompatibleTextRendering = true;
this.installButton.UseVisualStyleBackColor = true;
this.installButton.Click += new System.EventHandler(this.InstallButtonClick);
//
// closeButton
//
this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.closeButton.Location = new System.Drawing.Point(373, 6);
this.closeButton.Name = "closeButton";
this.closeButton.Size = new System.Drawing.Size(75, 23);
this.closeButton.TabIndex = 2;
this.closeButton.Text = "Close";
this.closeButton.UseCompatibleTextRendering = true;
this.closeButton.UseVisualStyleBackColor = true;
this.closeButton.Click += new System.EventHandler(this.CloseButtonClick);
//
// showPreinstalledAddInsCheckBox
//
this.showPreinstalledAddInsCheckBox.Location = new System.Drawing.Point(3, 6);
this.showPreinstalledAddInsCheckBox.Name = "showPreinstalledAddInsCheckBox";
this.showPreinstalledAddInsCheckBox.Size = new System.Drawing.Size(169, 24);
this.showPreinstalledAddInsCheckBox.TabIndex = 0;
this.showPreinstalledAddInsCheckBox.Text = "Show preinstalled AddIns";
this.showPreinstalledAddInsCheckBox.UseCompatibleTextRendering = true;
this.showPreinstalledAddInsCheckBox.UseVisualStyleBackColor = true;
this.showPreinstalledAddInsCheckBox.CheckedChanged += new System.EventHandler(this.ShowPreinstalledAddInsCheckBoxCheckedChanged);
//
// splitContainer
//
this.splitContainer.BackColor = System.Drawing.SystemColors.Window;
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer.Location = new System.Drawing.Point(0, 33);
this.splitContainer.Name = "splitContainer";
//
// splitContainer.Panel1
//
this.splitContainer.Panel1.AllowDrop = true;
this.splitContainer.Panel1.AutoScroll = true;
this.splitContainer.Panel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Panel1DragDrop);
this.splitContainer.Panel1.DragEnter += new System.Windows.Forms.DragEventHandler(this.Panel1DragEnter);
this.splitContainer.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.OnSplitContainerPanel1Paint);
this.splitContainer.Panel1MinSize = 100;
//
// splitContainer.Panel2
//
this.splitContainer.Panel2.Controls.Add(this.actionGroupBox);
this.splitContainer.Panel2MinSize = 100;
this.splitContainer.Size = new System.Drawing.Size(460, 322);
this.splitContainer.SplitterDistance = 248;
this.splitContainer.TabIndex = 2;
//
// actionGroupBox
//
this.actionGroupBox.Controls.Add(this.actionFlowLayoutPanel);
this.actionGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.actionGroupBox.Location = new System.Drawing.Point(0, 0);
this.actionGroupBox.Name = "actionGroupBox";
this.actionGroupBox.Size = new System.Drawing.Size(208, 322);
this.actionGroupBox.TabIndex = 0;
this.actionGroupBox.TabStop = false;
this.actionGroupBox.Text = "actionGroupBox";
this.actionGroupBox.UseCompatibleTextRendering = true;
//
// actionFlowLayoutPanel
//
this.actionFlowLayoutPanel.AutoScroll = true;
this.actionFlowLayoutPanel.Controls.Add(this.actionDescription);
this.actionFlowLayoutPanel.Controls.Add(this.dependencyTable);
this.actionFlowLayoutPanel.Controls.Add(this.runActionButton);
this.actionFlowLayoutPanel.Controls.Add(this.uninstallButton);
this.actionFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.actionFlowLayoutPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.actionFlowLayoutPanel.ForeColor = System.Drawing.SystemColors.WindowText;
this.actionFlowLayoutPanel.Location = new System.Drawing.Point(3, 17);
this.actionFlowLayoutPanel.Name = "actionFlowLayoutPanel";
this.actionFlowLayoutPanel.Size = new System.Drawing.Size(202, 302);
this.actionFlowLayoutPanel.TabIndex = 0;
this.actionFlowLayoutPanel.WrapContents = false;
//
// actionDescription
//
this.actionDescription.AutoSize = true;
this.actionDescription.Location = new System.Drawing.Point(3, 0);
this.actionDescription.Name = "actionDescription";
this.actionDescription.Size = new System.Drawing.Size(90, 18);
this.actionDescription.TabIndex = 0;
this.actionDescription.Text = "actionDescription";
this.actionDescription.UseCompatibleTextRendering = true;
//
// dependencyTable
//
this.dependencyTable.AutoSize = true;
this.dependencyTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.dependencyTable.ColumnCount = 2;
this.dependencyTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.dependencyTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.dependencyTable.Controls.Add(this.dummyLabel1, 1, 0);
this.dependencyTable.Controls.Add(this.dummyLabel2, 1, 1);
this.dependencyTable.Location = new System.Drawing.Point(3, 21);
this.dependencyTable.Name = "dependencyTable";
this.dependencyTable.RowCount = 2;
this.dependencyTable.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.dependencyTable.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.dependencyTable.Size = new System.Drawing.Size(55, 36);
this.dependencyTable.TabIndex = 1;
//
// dummyLabel1
//
this.dummyLabel1.AutoSize = true;
this.dummyLabel1.Location = new System.Drawing.Point(23, 0);
this.dummyLabel1.Name = "dummyLabel1";
this.dummyLabel1.Size = new System.Drawing.Size(29, 18);
this.dummyLabel1.TabIndex = 0;
this.dummyLabel1.Text = "dep1";
this.dummyLabel1.UseCompatibleTextRendering = true;
//
// dummyLabel2
//
this.dummyLabel2.AutoSize = true;
this.dummyLabel2.Location = new System.Drawing.Point(23, 18);
this.dummyLabel2.Name = "dummyLabel2";
this.dummyLabel2.Size = new System.Drawing.Size(29, 18);
this.dummyLabel2.TabIndex = 1;
this.dummyLabel2.Text = "dep2";
this.dummyLabel2.UseCompatibleTextRendering = true;
//
// runActionButton
//
this.runActionButton.AutoSize = true;
this.runActionButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.runActionButton.Location = new System.Drawing.Point(3, 63);
this.runActionButton.MinimumSize = new System.Drawing.Size(91, 25);
this.runActionButton.Name = "runActionButton";
this.runActionButton.Size = new System.Drawing.Size(91, 25);
this.runActionButton.TabIndex = 2;
this.runActionButton.Text = "runAction";
this.runActionButton.UseCompatibleTextRendering = true;
this.runActionButton.UseVisualStyleBackColor = true;
this.runActionButton.Click += new System.EventHandler(this.RunActionButtonClick);
//
// uninstallButton
//
this.uninstallButton.AutoSize = true;
this.uninstallButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.uninstallButton.Location = new System.Drawing.Point(3, 94);
this.uninstallButton.MinimumSize = new System.Drawing.Size(91, 25);
this.uninstallButton.Name = "uninstallButton";
this.uninstallButton.Size = new System.Drawing.Size(91, 25);
this.uninstallButton.TabIndex = 3;
this.uninstallButton.Text = "Uninstall";
this.uninstallButton.UseCompatibleTextRendering = true;
this.uninstallButton.UseVisualStyleBackColor = true;
this.uninstallButton.Click += new System.EventHandler(this.UninstallButtonClick);
//
// ManagerForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(460, 390);
this.Controls.Add(this.splitContainer);
this.Controls.Add(this.bottomPanel);
this.Controls.Add(this.topPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.MinimumSize = new System.Drawing.Size(250, 200);
this.Name = "ManagerForm";
this.Text = "AddIn Manager";
this.bottomPanel.ResumeLayout(false);
this.splitContainer.Panel2.ResumeLayout(false);
this.splitContainer.ResumeLayout(false);
this.actionGroupBox.ResumeLayout(false);
this.actionFlowLayoutPanel.ResumeLayout(false);
this.actionFlowLayoutPanel.PerformLayout();
this.dependencyTable.ResumeLayout(false);
this.dependencyTable.PerformLayout();
this.ResumeLayout(false);
}
private System.Windows.Forms.Label dummyLabel2;
private System.Windows.Forms.Label dummyLabel1;
private System.Windows.Forms.CheckBox showPreinstalledAddInsCheckBox;
private System.Windows.Forms.Button installButton;
private System.Windows.Forms.Button uninstallButton;
private System.Windows.Forms.Button runActionButton;
private System.Windows.Forms.TableLayoutPanel dependencyTable;
private System.Windows.Forms.Label actionDescription;
private System.Windows.Forms.FlowLayoutPanel actionFlowLayoutPanel;
private System.Windows.Forms.GroupBox actionGroupBox;
private System.Windows.Forms.Button closeButton;
private System.Windows.Forms.SplitContainer splitContainer;
private System.Windows.Forms.Panel bottomPanel;
private System.Windows.Forms.Panel topPanel;
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -