?? plugin.cs
字號:
// Plugin.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.Xml;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.Serialization.Formatters.Binary;
using SharpDevelop.Gui;
using SharpDevelop.Tool.Function;
using SharpDevelop.Actions.Edit;
namespace SharpDevelop.Internal.Plugin {
class Plugin
{
string assemblyname;
string name;
string author;
string version;
string description = "";
string copyright = "";
string url = "";
ArrayList editactions = null;
MenuItem[] menuitems = null;
Assembly assembly;
MainWindow window;
public ArrayList EditActions {
get {
return editactions;
}
}
public MenuItem[] MenuItems {
get {
return menuitems;
}
}
public string AssemblyName {
get {
return assemblyname;
}
}
public string Url {
get {
return url;
}
}
public string Copyright {
get {
return copyright;
}
}
public string Name {
get {
return name;
}
}
public string Description {
get {
return description;
}
}
public string Author {
get {
return author;
}
}
public string Version {
get {
return version;
}
}
public Plugin(MainWindow window, string directory, XmlElement el)
{
this.window = window;
assemblyname = el["Plugin"].Attributes["Assembly"].InnerText;
name = el["Plugin"].Attributes["Name"].InnerText;
version = el["Plugin"].Attributes["Version"].InnerText;
author = el["Plugin"]["Author"].InnerText;
copyright = el["Plugin"]["Copyright"].InnerText;
url = el["Plugin"]["Url"].InnerText;
description = el["Plugin"]["Description"].InnerText;
if (directory[directory.Length -1] != '\\')
directory += '\\';
try {
assembly = Assembly.LoadFrom(directory + assemblyname);
// messagehandler =
} catch (Exception e) {
throw new Exception("Can't load Assembly error :\n " + e.ToString());
}
if (el["MenuStructure"] != null) {
try {
menuitems = MenuCreator.CreateMenu(window, assembly, "", el["MenuStructure"]);
} catch (Exception e) {
throw new Exception("Can't create Menu error (check the XML) :\n " + e.ToString());
}
}
if (el["EditorKeys"] != null) {
try {
editactions = EditActionLoader.GenEditActions(assembly, "", el["EditorKeys"]);
foreach (object o in editactions) // insert keys into EditActionLoader
EditActionLoader.EditAction.Add(o);
} catch (Exception e) {
throw new Exception("Can't create EditActions error (check the XML) :\n " + e.ToString());
}
}
}
public override string ToString()
{
return Name + " " + Version;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -