Hishop.TransferManager/TransferContainer.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace Hishop.TransferManager
{
using System;
using System.Data;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.Caching;
internal class TransferContainer
{
private static volatile TransferContainer _instance = null;
private const string CacheKey = "Hishop_TransferIndexes";
private static readonly object LockHelper = new object();
private static volatile Cache TransferCache = HttpRuntime.Cache;
private TransferContainer()
{
TransferCache.Remove("Hishop_TransferIndexes");
}
private static void AddToExportIndex(Type t, string filename, DataTable dtExporters)
{
ExportAdapter adapter = Activator.CreateInstance(t) as ExportAdapter;
DataRow row = dtExporters.NewRow();
row["fullName"] = t.FullName.ToLower();
row["filePath"] = filename;
row["sourceName"] = adapter.Source.Name;
row["sourceVersion"] = adapter.Source.Version.ToString();
row["exportToName"] = adapter.ExportTo.Name;
row["exportToVersion"] = adapter.ExportTo.Version.ToString();
dtExporters.Rows.Add(row);
}
private static void AddToImportIndex(Type t, string filename, DataTable dtImporters)
{
ImportAdapter adapter = Activator.CreateInstance(t) as ImportAdapter;
DataRow row = dtImporters.NewRow();
row["fullName"] = t.FullName.ToLower();
row["filePath"] = filename;
row["sourceName"] = adapter.Source.Name;
row["sourceVersion"] = adapter.Source.Version.ToString();
row["importToName"] = adapter.ImportTo.Name;
row["importToVersion"] = adapter.ImportTo.Version.ToString();
dtImporters.Rows.Add(row);
}
private static void BuildIndex(string pluginPath, DataTable dtExporters, DataTable dtImporters)
{
if (Directory.Exists(pluginPath))
{
foreach (string str in Directory.GetFiles(pluginPath, "*.dll", SearchOption.AllDirectories))
{
foreach (Type type in Assembly.Load(LoadPluginFile(str)).GetExportedTypes())
{
if (type.BaseType != null)
{
if (type.BaseType.Name == "ExportAdapter")
{
后面还有 107 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
