2006-03-15 13:42:25 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
namespace BinLogReader
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// plugin data
|
|
|
|
/// </summary>
|
|
|
|
public class Plugin
|
|
|
|
{
|
|
|
|
private byte status;
|
|
|
|
private string Filename;
|
|
|
|
private ArrayList Natives;
|
|
|
|
private ArrayList Publics;
|
2006-08-21 04:18:13 +00:00
|
|
|
private ArrayList Files;
|
2006-03-16 06:40:18 +00:00
|
|
|
private string title;
|
|
|
|
private string version;
|
|
|
|
private int index;
|
2006-03-15 13:42:25 +00:00
|
|
|
|
2006-03-16 06:40:18 +00:00
|
|
|
public string File
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return Filename;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public string Title
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
title = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public string Version
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return version;
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
version = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public string Status
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (status == 0)
|
|
|
|
return "Failed";
|
|
|
|
else if (status == 1)
|
|
|
|
return "Running";
|
|
|
|
else if (status == 2)
|
|
|
|
return "Debug";
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int Index
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-08-21 04:18:13 +00:00
|
|
|
public Plugin(string name, int natives, int publics, int files, byte _status, int _index)
|
2006-03-15 13:42:25 +00:00
|
|
|
{
|
|
|
|
Filename = name;
|
|
|
|
Natives = new ArrayList(natives);
|
|
|
|
Publics = new ArrayList(publics);
|
2006-08-21 04:18:13 +00:00
|
|
|
Files = new ArrayList(files+1);
|
2006-03-15 13:42:25 +00:00
|
|
|
status = _status;
|
2006-03-16 06:40:18 +00:00
|
|
|
index = _index;
|
2006-03-15 13:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void AddNative(string name)
|
|
|
|
{
|
|
|
|
Natives.Add(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void AddPublic(string pubname)
|
|
|
|
{
|
|
|
|
Publics.Add(pubname);
|
|
|
|
}
|
|
|
|
|
2006-08-21 04:18:13 +00:00
|
|
|
public void AddFile(string filename)
|
|
|
|
{
|
|
|
|
Files.Add(filename);
|
|
|
|
}
|
|
|
|
|
2006-03-15 13:42:25 +00:00
|
|
|
public string FindNative(int id)
|
|
|
|
{
|
|
|
|
if (id < 0 || id >= Natives.Count)
|
2006-08-21 04:18:13 +00:00
|
|
|
{
|
2006-03-15 13:42:25 +00:00
|
|
|
return null;
|
2006-08-21 04:18:13 +00:00
|
|
|
}
|
2006-03-15 13:42:25 +00:00
|
|
|
|
|
|
|
return (string)Natives[id];
|
|
|
|
}
|
|
|
|
|
2006-08-21 04:18:13 +00:00
|
|
|
public string FindFile(int id)
|
|
|
|
{
|
|
|
|
if (id < 0 || id >= Files.Count)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (string)Files[id];
|
|
|
|
}
|
|
|
|
|
2006-03-15 13:42:25 +00:00
|
|
|
public string FindPublic(int id)
|
|
|
|
{
|
|
|
|
if (id < 0 || id >= Publics.Count)
|
2006-08-21 04:18:13 +00:00
|
|
|
{
|
2006-03-15 13:42:25 +00:00
|
|
|
return null;
|
2006-08-21 04:18:13 +00:00
|
|
|
}
|
2006-03-15 13:42:25 +00:00
|
|
|
|
|
|
|
return (string)Publics[id];
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsValid()
|
|
|
|
{
|
|
|
|
return status != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsDebug()
|
|
|
|
{
|
|
|
|
return status == 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|