2 using System
.Collections
;
4 using System
.Reflection
;
11 private readonly string a
, c
;
13 public Source(string a
, string c
)
19 public string Assembly
29 public static bool operator == (Source s1
, Source s2
)
31 return s1
.Assembly
== s2
.Assembly
&& s1
.Class
== s2
.Class
;
34 public static bool operator != (Source s1
, Source s2
)
39 public override bool Equals(object o
)
43 return this == (Source
)o
;
46 public override int GetHashCode()
48 return a
.GetHashCode() ^ c
.GetHashCode();
54 public static ArrayList In
= new ArrayList();
55 public static ArrayList Out
= new ArrayList();
56 public static ArrayList ImgProc
= new ArrayList();
57 public static ArrayList ResProc
= new ArrayList();
58 public static ArrayList Comparator
= new ArrayList();
59 public static ArrayList Other
= new ArrayList();
61 public static Hashtable Origin
= new Hashtable();
62 public static Hashtable RevOrigin
= new Hashtable();
64 public static void LoadPlugins(Splash s
)
66 string basedir
= Path
.Combine(System
.AppDomain
.CurrentDomain
.BaseDirectory
, "Plugins");
67 string[] tmp
= Directory
.GetFiles(basedir
, "*.dll");
68 string[] p
= new string[tmp
.Length
+ 1];
70 p
[0] = System
.Reflection
.Assembly
.GetExecutingAssembly().Location
;
71 for(int i
=0; i
<tmp
.Length
; i
++)
76 foreach(string fn
in p
)
80 s
.Message
= Catalog
.GetString("Inspecting ") + fn
;
81 s
.Progress
= ++count
/ (float)(tmp
.Length
+ 1);
82 Assembly a
= Assembly
.LoadFrom(fn
);
84 foreach(Type t
in a
.GetTypes())
86 if(t
.GetInterface(typeof(IFactory
).FullName
) != null && !t
.IsAbstract
)
88 IFactory f
= (IFactory
)Activator
.CreateInstance(t
);
104 case IType
.Comparator
:
112 Origin
.Add(f
, new Source(Path
.GetFileName(fn
), t
.FullName
));
113 RevOrigin
.Add(new Source(Path
.GetFileName(fn
), t
.FullName
), f
);
119 Console
.WriteLine(Catalog
.GetString("Error while processing {0}: {1}"), fn
, e
.Message
);