ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.PluginFramework/Core/PluginLoader.cs
Revision: 84
Committed: Wed May 9 17:55:55 2012 UTC (10 years, 3 months ago) by william
File size: 1604 byte(s)
Log Message:

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.Logging;
7 using System.IO;
8
9 namespace RomCheater.PluginFramework.Core
10 {
11 public class PluginLoader : IPluginLoader
12 {
13 public PluginLoader()
14 {
15 LoadedConfigPlugins = new List<IConfigPlugin>();
16 LoadedInputPlugins = new List<IInputPlugin>();
17 LoadedWindowPlugins = new List<IWindowPlugin>();
18 }
19 #region IPluginLoader Members
20
21 public void LoadPlugins()
22 {
23 logger.Info.WriteLine("Loading Plugins...");
24
25 string PluginPath = string.Format(@"{0}\Plugins", typeof(PluginLoader).Assembly.Location.Replace(@"\RomCheater.PluginFramework.dll", ""));
26 logger.Debug.WriteLine("Plugins Path: {0}", PluginPath);
27 List<string> dlls = new List<string>(Directory.GetFiles(PluginPath, "*.dll"));
28 logger.Debug.WriteLine(" Found: {0} plugin dlls", dlls.Count);
29 foreach (string dll in dlls)
30 {
31 FileInfo fi = new FileInfo(dll);
32 logger.Debug.WriteLine(" plugin[{0}]: {1}", dlls.IndexOf(dll), fi.Name);
33 }
34 logger.Info.WriteLine("Plugins Loaded.");
35 }
36 public List<IConfigPlugin> LoadedConfigPlugins { get; private set; }
37 public List<IInputPlugin> LoadedInputPlugins { get; private set; }
38 public List<IWindowPlugin> LoadedWindowPlugins { get; private set; }
39 #endregion
40 }
41 }