| 0: | // PluginViewer.cs | |
| 1: | // Copyright (C) 2000 Mike Krueger | |
| 2: | // | |
| 3: | // This program is free software; you can redistribute it and/or modify | |
| 4: | // it under the terms of the GNU General Public License as published by | |
| 5: | // the Free Software Foundation; either version 2 of the License, or | |
| 6: | // (at your option) any later version. | |
| 7: | // | |
| 8: | // This program is distributed in the hope that it will be useful, | |
| 9: | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10: | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 11: | // GNU General Public License for more details. | |
| 12: | // | |
| 13: | // You should have received a copy of the GNU General Public License | |
| 14: | // along with this program; if not, write to the Free Software | |
| 15: | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 16: | ||
| 17: | using System; | |
| 18: | using System.Drawing; | |
| 19: | using System.ComponentModel; | |
| 20: | using System.Windows.Forms; | |
| 21: | ||
| 22: | using SharpDevelop.Internal.Plugin; | |
| 23: | using SharpDevelop.Gui; | |
| 24: | ||
| 25: | namespace SharpDevelop.Gui.Dialogs { | |
| 26: | ||
| 27: | /// <summary> | |
| 28: | /// This class views plugin information, future versions may | |
| 29: | /// install/uninstall plugins or download new plugins from the web | |
| 30: | /// </summary> | |
| 31: | public class PluginViewer : Form | |
| 32: | { | |
| 33: | private System.ComponentModel.Container components; | |
| 34: | private Button button1; | |
| 35: | private Label label2; | |
| 36: | private RichTextBox richTextBox1; | |
| 37: | ||
| 38: | private ListBox listBox1; | |
| 39: | ||
| 40: | private Label label1; | |
| 41: | PluginManager pluginmanager; | |
| 42: | ||
| 43: | public PluginViewer(MainWindow main) | |
| 44: | { | |
| 45: | InitializeComponent(); | |
| 46: | Owner = main; | |
| 47: | StartPosition = FormStartPosition.CenterParent; | |
| 48: | MaximizeBox = MinimizeBox = false; | |
| 49: | ShowInTaskbar = false; | |
| 50: | FormBorderStyle = FormBorderStyle.FixedDialog; | |
| 51: | ||
| 52: | Icon = null; | |
| 53: | ||
| 54: | pluginmanager = main.PluginManager; | |
| 55: | ||
| 56: | foreach (Plugin p in pluginmanager.PlugIns) { | |
| 57: | listBox1.Items.Add(p); | |
| 58: | } | |
| 59: | } | |
| 60: | ||
| 61: | protected override void OnClosed(EventArgs e) | |
| 62: | { | |
| 63: | base.OnClosed(e); | |
| 64: | Dispose(true); | |
| 65: | } | |
| 66: | ||
| 67: | /// <summary> | |
| 68: | /// Clean up any resources being used. | |
| 69: | /// </summary> | |
| 70: | protected override void Dispose(bool disposing) | |
| 71: | { | |
| 72: | if (disposing) { | |
| 73: | if (components != null){ | |
| 74: | components.Dispose(); | |
| 75: | } | |
| 76: | } | |
| 77: | base.Dispose(disposing); | |
| 78: | } | |
| 79: | ||
| 80: | void ViewDescription(object sender, EventArgs e) | |
| 81: | { | |
| 82: | Plugin p = (Plugin)listBox1.SelectedItem; | |
| 83: | if (p == null) { | |
| 84: | richTextBox1.Text = ""; | |
| 85: | return; | |
| 86: | } | |
| 87: | richTextBox1.Text = "AUTHOR : " + p.Author + "\nDESCRIPTION:\n" + p.Description; | |
| 88: | } | |
| 89: | ||
| 90: | private void InitializeComponent() | |
| 91: | { | |
| 92: | this.components = new System.ComponentModel.Container(); | |
| 93: | this.button1 = new Button(); | |
| 94: | this.label1 = new Label(); | |
| 95: | this.label2 = new Label(); | |
| 96: | this.listBox1 = new ListBox(); | |
| 97: | this.richTextBox1 = new RichTextBox(); | |
| 98: | ||
| 99: | button1.Location = new System.Drawing.Point(8, 208); | |
| 100: | button1.Size = new System.Drawing.Size(75, 23); | |
| 101: | button1.TabIndex = 4; | |
| 102: | button1.Text = "OK"; | |
| 103: | button1.DialogResult = DialogResult.OK; | |
| 104: | ||
| 105: | label1.Location = new System.Drawing.Point(8, 8); | |
| 106: | label1.Text = "Installed Plugins"; | |
| 107: | label1.Size = new System.Drawing.Size(88, 16); | |
| 108: | label1.TabIndex = 0; | |
| 109: | ||
| 110: | label2.Location = new System.Drawing.Point(184, 8); | |
| 111: | label2.Text = "Info"; | |
| 112: | label2.Size = new System.Drawing.Size(56, 16); | |
| 113: | label2.TabIndex = 3; | |
| 114: | ||
| 115: | listBox1.Location = new System.Drawing.Point(8, 24); | |
| 116: | listBox1.Size = new System.Drawing.Size(168, 173); | |
| 117: | listBox1.TabIndex = 1; | |
| 118: | listBox1.Click += new EventHandler(ViewDescription); | |
| 119: | ||
| 120: | richTextBox1.Size = new System.Drawing.Size(272, 173); | |
| 121: | richTextBox1.TabIndex = 2; | |
| 122: | richTextBox1.Location = new System.Drawing.Point(184, 24); | |
| 123: | this.Text = "Plugin Manager"; | |
| 124: | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); | |
| 125: | this.ClientSize = new System.Drawing.Size(464, 237); | |
| 126: | ||
| 127: | this.Controls.Add(button1); | |
| 128: | this.Controls.Add(label2); | |
| 129: | this.Controls.Add(richTextBox1); | |
| 130: | this.Controls.Add(listBox1); | |
| 131: | this.Controls.Add(label1); | |
| 132: | } | |
| 133: | } | |
| 134: | } |
This page was automatically generated by SharpDevelop.