ImportExport/ImportExport.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ComLib.MapperSupport;
namespace ComLib.ImportExport
{
/// <summary>
/// Import Export convenience class to store collection of various importexport services.
/// </summary>
public class ImportExports
{
private static ImportExports _instance = new ImportExports();
private IDictionary<string, IImportExportService> _ioServices = new Dictionary<string, IImportExportService>();
private IDictionary<string, IImportExportService> _ioServicesShortName = new Dictionary<string, IImportExportService>();
/// <summary>
/// Gets the default instance of importexports
/// </summary>
public static ImportExports Instance
{
get { return _instance; }
}
/// <summary>
/// Register the ImportExport service.
/// </summary>
/// <typeparam name="T"></typeparam>
public void Register<T>() where T : class, new()
{
Register<T>(null, new string[] { "csv", "ini", "xml" }, true);
}
/// <summary>
/// Register the import export service.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="validator">Validator for the importexport service.</param>
/// <param name="supportedFormats">Formats supported. e.g. "csv,xml,ini".</param>
/// <param name="isReusable">Whether or not the service is reusable.</param>
public void Register<T>(IValidator validator, string[] supportedFormats, bool isReusable) where T: class, new()
{
IImportExportService<T> ioService = new ImportExportService<T>();
ioService.Init(validator, supportedFormats);
Register<T>(ioService);
}
/// <summary>
/// Register the import export service.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="validator">Validator for the importexport service.</param>
/// <param name="isReusable">Whether or not the service is reusable.</param>
/// <param name="mappers">The mappers that can be used for importing/exporting the type.</param>
后面还有 44 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
