1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| using System;
| using System.Collections.Generic;
| using System.Linq;
| using System.Reflection;
| using System.Text;
| using System.Threading.Tasks;
|
| namespace IStation
| {
| /// <summary>
| ///
| /// </summary>
| public class DataDockingApiFactory
| {
|
| /// <summary>
| /// 创建Api
| /// </summary>
| public static I CreateApi<I>(string dllName)
| {
| var type = typeof(I);
| var className = string.Format("{0}.{1}", "IStation.DataDockingApi", type.Name.Remove(0, 1));
| var obj = Assembly.Load(dllName).CreateInstance(className);
| return (I)obj;
| }
|
|
|
|
| }
| }
|
|