ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.PluginFramework/Core/PluginBase.cs
Revision: 682
Committed: Mon Jun 17 08:27:34 2013 UTC (9 years, 3 months ago) by william
File size: 1936 byte(s)
Log Message:
+ fix-up null plugins

File Contents

# Content
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using RomCheater.PluginFramework.Interfaces;
6 using RomCheater.PluginFramework.Events;
7 using System.Diagnostics;
8
9 namespace RomCheater.PluginFramework.Core
10 {
11 /// <summary>
12 /// The base class for all plugins
13 /// </summary>
14 public abstract class PluginBase : IPluginBase
15 {
16 public PluginBase() { }
17
18 public virtual bool IsNullPlugin { get { return false; } }
19 public virtual bool IsGenericPlugin { get { return false; } }
20
21 #region IPluginBase Members
22 public abstract Guid ID { get; }
23 public abstract string Name { get; }
24 public abstract string Description { get; }
25 public virtual void Reload() { Reload(false); }
26 public abstract void Reload(bool silent);
27 #endregion
28 public override string ToString()
29 {
30 return string.Format("{0} [{1}]", Name, ID.ToString());
31 }
32
33 private IPEDData _peData;
34 protected IPEDData peData { get { return _peData; } }
35 public void SetPEViewerData(IPEDData peData)
36 {
37 _peData = peData;
38 }
39
40 private Process _AcceptedProcess;
41 protected Process AcceptedProcess { get { return _AcceptedProcess; } }
42 public void SetAcceptedProcess(Process proc)
43 {
44 _AcceptedProcess = proc;
45 }
46
47 private IConfigPlugin _AcceptedConfig;
48 protected IConfigPlugin AcceptedConfig { get { return _AcceptedConfig; } }
49 public void SetAcceptedConfig(IConfigPlugin config)
50 {
51 _AcceptedConfig = config;
52 }
53
54
55 public void SetAcceptedProcessAndConfig(IAcceptsProcessAndConfig iapc)
56 {
57 SetAcceptedConfig(iapc.AcceptedPlugin);
58 SetAcceptedProcess(iapc.AcceptedProcess);
59 }
60 }
61 }