📄 pluginviewer.cs
字号:
// PluginViewer.cs
// Copyright (C) 2000 Mike Krueger
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using SharpDevelop.Internal.Plugin;
using SharpDevelop.Gui;
namespace SharpDevelop.Gui.Dialogs {
/// <summary>
/// This class views plugin information, future versions may
/// install/uninstall plugins or download new plugins from the web
/// </summary>
public class PluginViewer : Form
{
private System.ComponentModel.Container components;
private Button button1;
private Label label2;
private RichTextBox richTextBox1;
private ListBox listBox1;
private Label label1;
PluginManager pluginmanager;
public PluginViewer(MainWindow main)
{
InitializeComponent();
Owner = main;
StartPosition = FormStartPosition.CenterParent;
MaximizeBox = MinimizeBox = false;
ShowInTaskbar = false;
FormBorderStyle = FormBorderStyle.FixedDialog;
Icon = null;
pluginmanager = main.PluginManager;
foreach (Plugin p in pluginmanager.PlugIns) {
listBox1.Items.Add(p);
}
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
Dispose();
}
void ViewDescription(object sender, EventArgs e)
{
Plugin p = (Plugin)listBox1.SelectedItem;
if (p == null) {
richTextBox1.Text = "";
return;
}
richTextBox1.Text = "AUTHOR : " + p.Author + "\nDESCRIPTION:\n" + p.Description;
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.button1 = new Button();
this.label1 = new Label();
this.label2 = new Label();
this.listBox1 = new ListBox();
this.richTextBox1 = new RichTextBox();
button1.Location = new System.Drawing.Point(8, 208);
button1.Size = new System.Drawing.Size(75, 23);
button1.TabIndex = 4;
button1.Text = "OK";
button1.DialogResult = DialogResult.OK;
label1.Location = new System.Drawing.Point(8, 8);
label1.Text = "Installed Plugins";
label1.Size = new System.Drawing.Size(88, 16);
label1.TabIndex = 0;
label2.Location = new System.Drawing.Point(184, 8);
label2.Text = "Info";
label2.Size = new System.Drawing.Size(56, 16);
label2.TabIndex = 3;
listBox1.Location = new System.Drawing.Point(8, 24);
listBox1.Size = new System.Drawing.Size(168, 173);
listBox1.TabIndex = 1;
listBox1.Click += new EventHandler(ViewDescription);
richTextBox1.Size = new System.Drawing.Size(272, 173);
richTextBox1.TabIndex = 2;
richTextBox1.Location = new System.Drawing.Point(184, 24);
this.Text = "Plugin Manager";
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(464, 237);
this.Controls.Add(button1);
this.Controls.Add(label2);
this.Controls.Add(richTextBox1);
this.Controls.Add(listBox1);
this.Controls.Add(label1);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -