private static async Task ResolveDmPlugin() { SettingsViewModel model = SoftContext.Locator.Settings; if (!File.Exists(model.DmFile)) { await SoftContext.ShowMessageAsync("错误", $"指定大漠路径“{model.DmFile}”的文件不存在"); return; } try { DmPlugin dm = new DmPlugin(model.DmFile); Version ver = new Version(dm.Ver()); model.DmVersion = ver.ToString(); model.DmVersionShow = true; model.DmRegCodeShow = ver > new Version("3.1233"); SoftContext.DmSystem = new DmSystem(dm); } catch (Exception ex) { await SoftContext.MainWindow.Dispatcher.Invoke(async() => { await SoftContext.ShowMessageAsync("错误", $"大漠初始化错误:{ex.Message}"); }); model.DmFile = null; } }
public void Can_generate_schema() { Database.SetInitializer<SoftContext>(null); var ctx = new SoftContext("Test"); var result = ctx.CreateDatabaseScript(); result.ShouldNotBeNull(); Console.Write(result); }
public bool AutoLogin(Role role, Account account) { if (account == null) { account = SoftContext.GetAccount(); if (account == null) { Debug.WriteLine("所有帐号已经执行完毕!"); return(false); } } if (role == null) { return(false); } if (account.IsFinished == true) { return(false); } role.CurrentAccount = account; bool result = false; account.IsWorking = true; SoftContext.Locator.Accounts.SetAccountState(account); switch (account.Platform) { case Platform.飞流: result = FeiliuLogin(account, role); break; case Platform.楚游: result = FeiliuLogin(account, role); break; } if (result) { // account = null; return(true); } return(false); }
async public Task Save(DbContext obj) { SoftContext db = obj as SoftContext; await db.SaveChangesAsync(); }
public ForumRepository(SoftContext db) { this.db = db; }
public ForumRepository() { db = new SoftContext(); }
public MainThemeRepository(SoftContext db) { this.db = db; }
public MainThemeRepository() { db = new SoftContext(); }
public ReplyModelRepository(SoftContext db) { this.db = db; }
public ReplyModelRepository() { db = new SoftContext(); }
public MainArticleModelRepository(SoftContext db) { this.db = db; }
public MainArticleModelRepository() { db = new SoftContext(); }