SimpleAssemblyExplorer.Plugin.PluginInfo
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace SimpleAssemblyExplorer.Plugin
{
/// <summary>
/// Return values of plugin
/// </summary>
public enum PluginReturns
{
/// <summary>
/// Do nothing
/// </summary>
None,
/// <summary>
/// Refresh host
/// </summary>
Refresh
}
/// <summary>
/// Source files type which plugin can handle
/// </summary>
public enum SourceTypes
{
/// <summary>
/// Assemblies
/// </summary>
Assembly,
/// <summary>
/// Executable assembly
/// </summary>
Executable,
/// <summary>
/// IL files
/// </summary>
ILFile,
/// <summary>
/// Any files
/// </summary>
Any
}
/// <summary>
/// Rows whick plugin can handle
/// </summary>
public enum RowTypes
{
/// <summary>
/// One row
/// </summary>
One,
/// <summary>
/// Multiple row
/// </summary>
Multiple
}
/// <summary>
/// Plugin information
/// </summary>
public class PluginInfo
{
protected string _title;
protected string _version;
protected string _url;
protected string _author;
protected string _contact;
protected SourceTypes _sourceType;
protected RowTypes _rowType;
/// <summary>
/// Plugin Title which will be shown on menu
/// </summary>
public string Title
{
get { return _title; }
set { _title = value; }
}
/// <summary>
/// Plugin Author
/// </summary>
public string Author
{
get { return _author; }
set { _author = value; }
}
/// <summary>
/// Email address of plugin author
/// </summary>
public string Contact
{
get { return _contact; }
set { _contact = value; }
}
/// <summary>
/// Web site of plugin
/// </summary>
public string Url
{
get { return _url; }
set { _url = value; }
}
/// <summary>
/// Plugin Version
/// </summary>
public string Version
{
get
{
if (String.IsNullOrEmpty(_version))
{
_version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
return _version;
}
set { _version = value; }
}
/// <summary>
/// Source files which plugin can handle
/// </summary>
public SourceTypes SourceType
{
get { return _sourceType; }
set { _sourceType = value; }
}
/// <summary>
/// Rows which plugin can handle
/// </summary>
public RowTypes RowType
{
get { return _rowType; }
set { _rowType = value; }
}
/// <summary>
/// Default constructor
/// </summary>
public PluginInfo()
{
}
}
/// <summary>
/// Plugin Argument
/// </summary>
public class PluginArgument
{
IHost _host;
string[] _rows;
string _sourceDir;
object _data;
/// <summary>
/// Plugin Argument
/// </summary>
/// <param name="host">provide access to host</param>
/// <param name="rows">selected rows</param>
/// <param name="sourceDir">current source directory</param>
/// <param name="data">additional data</param>
public PluginArgument(IHost host, string[] rows, string sourceDir, object data)
{
Init(host, rows, sourceDir, data);
}
public PluginArgument(IHost host, string[] rows, string sourceDir)
{
Init(host, rows, sourceDir, null);
}
private void Init(IHost host, string[] rows, string sourceDir, object data)
{
_host = host;
_rows = rows;
_sourceDir = sourceDir;
_data = data;
}
public IHost Host
{
get { return _host; }
}
public string[] Rows
{
get { return _rows; }
}
public string SourceDir
{
get { return _sourceDir; }
}
public object Data
{
get { return _data; }
}
}
}
|