using System;
using System.Collections.Generic;
namespace FaibClass.SourcePackage
{
/// <summary>
/// 提供数据源接口。
/// </summary>
public interface ISource : BasePackage.IPackage, IDisposable
{
/// <summary>
/// 打开获取数据源的对话框。
/// </summary>
/// <param name="option"></param>
/// <returns>如果打开失败返回false。</returns>
bool Open(SourceOptions option);
/// <summary>
/// 打开数据源地址。
/// </summary>
/// <param name="option"></param>
/// <param name="url"></param>
void Open(SourceOptions option, string url);
/// <summary>
/// 获取历史列表。
/// </summary>
/// <returns></returns>
Dictionary<string, object> GetRecentHistory();
/// <summary>
/// 表集合。
/// </summary>
Collection<ITable> Tables { get; }
string Schema { get; }
/// <summary>
/// 获取当前数据源中的所有表集合。
/// </summary>
void GetTables();
/// <summary>
/// 获取表的个数。
/// </summary>
/// <returns></returns>
int GetTableCount();
/// <summary>
/// 获取数据类型。
/// </summary>
string DbType { get; }
/// <summary>
/// 用到的枚举集合。
/// </summary>
Collection<DbEnum> Enums { get; }
/// <summary>
/// 获取到表时触发事件。
/// </summary>
event GetTableEventHandler GetTable;
string OutputFolder { get; set; }
ITable CreateTable(string name);
}
public delegate bool GetTableEventHandler(ITable table);
}