static void Main() { LeoController.InitDatabase(); // 初始化数据库 //// 设置当前的数据库联接 //string ConnectionString = AccessConnectionProvider.GetConnectionString("Web.mdb"); //SQLiteConnectionProvider.GetConnectionString("Web.DB"); ////XpoDefault.DataLayer = XpoDefault.GetDataLayer(ConnectionString, AutoCreateOption.DatabaseAndSchema); //// 加入线程安全 //List<Assembly> dataAssemblies = new List<Assembly>(); //dataAssemblies.Add(typeof(Leo2.Model.Page).Assembly); //dataAssemblies.Add(typeof(Leo2.Model.Web).Assembly); ////XpoDefault.ConnectionString = AccessConnectionProvider.GetConnectionString("data.mdb"); ////var dataStore = XpoDefault.GetConnectionProvider(AutoCreateOption.DatabaseAndSchema); ////var dict = new ReflectionDictionary(); ////dict.CollectClassInfos(dataAssemblies.ToArray()); ////var dataLayer = new ThreadSafeDataLayer(dict, dataStore); //DevExpress.Xpo.Metadata.XPDictionary dict = new DevExpress.Xpo.Metadata.ReflectionDictionary(); //IDataStore store = XpoDefault.GetConnectionProvider(ConnectionString, AutoCreateOption.SchemaAlreadyExists); //dict.GetDataStoreSchema(dataAssemblies.ToArray()); //ThreadSafeDataLayer datalayer = new ThreadSafeDataLayer(dict, store); //XpoDefault.DataLayer = datalayer; // 设置皮肤 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevExpress.Skins.SkinManager.EnableFormSkins(); // 增加汉化 System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN"); // 显示主窗口 //SplashScreenManager.ShowForm(typeof(frmWelcome), true, true); LeoController mainController = new LeoController(); mainController.View = new frmMain(mainController); Application.Run(mainController.View); }
// 构造函数,初始化必要的数据 public frmMain(LeoController controller) { InitializeComponent(); m_controller = controller; m_webs = m_controller.GetAllWebs(); }
private void ShowPageDownloadComplete(object sender, LeoController.PageDownloadCompleteEventArgs e) { if (this.InvokeRequired) { this.BeginInvoke(new LeoController.PageDownloadCompleteHandler(ShowPageDownloadComplete), new object[] { null, e }); } else { beiStatus.Caption = string.Format(@"[{0}-{1}]下载完成!", e.page.ParentWeb.Name, e.page.Title); } }