private void button1_Click() { SetupInput = new ConfigureInput(_setupInput); if (Setup()) { // start the engines rendering loop engine.StartRendering(); } }
public ConfigureResult Configure(ConfigureInput input) { var result = new ConfigureResult(); if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { result.Error("This resource is only compatible with Windows."); } return(result); }
public ConfigureResult Configure(ConfigureInput input) { _log.LogDebug("{method}: ", nameof(Configure)); _log.LogTrace("->input = {@input}", input); _log.LogTrace("->state = {@state}", this); // TODO: configure and return any validation errors var result = new ConfigureResult(); _log.LogTrace("<-state = {@state}", this); _log.LogTrace("<-result = {@result}", result); return(result); }
public TechDemo() { SetupInput = new ConfigureInput( _setupInput ); }
public string Configure(ConfigureInput input) { var IsShowCSS = input.IsShowCSS == "on"; var IsDisCSS = input.IsDisCSS == "on"; if (BLLSession.UserInfoSessioin == null) { return("您还没有登录 不能修改~"); } try { //============================================================================================================== //遗留问题: //如下:如果 userinfobll.Up(BLLSession.UserInfoSessioin.BlogUserInfo)两次的话 报异常:[一个实体对象不能由多个 IEntityChangeTracker 实例引用] //那么 我只能 new一个新的对象 修改 然后 同时 BLLSession.UserInfoSessioin.BlogUserInfo里面的属性,不然 其他地方访问的话 是没有修改过来的值 //============================================================================================================== var userinftemp = new BlogUserInfo(); //BLLSession.UserInfoSessioin.BlogUserInfo; BLL.BaseBLL <BlogUserInfo> userinfobll = new BaseBLL <BlogUserInfo>(); if (input.TerminalType == "PC") //如果是PC端 { userinftemp.IsShowCSS = BLLSession.UserInfoSessioin.BlogUserInfo.IsShowCSS = IsShowCSS; userinftemp.IsDisCSS = BLLSession.UserInfoSessioin.BlogUserInfo.IsDisCSS = IsDisCSS; userinftemp.Id = BLLSession.UserInfoSessioin.BlogUserInfo.Id; userinfobll.Updata(userinftemp, "IsShowCSS", "IsDisCSS");//"IsShowHTML",, "IsShowJS" } else { userinftemp.IsShowMCSS = BLLSession.UserInfoSessioin.BlogUserInfo.IsShowMCSS = IsShowCSS; userinftemp.IsDisMCSS = BLLSession.UserInfoSessioin.BlogUserInfo.IsDisMCSS = IsDisCSS; userinftemp.Id = BLLSession.UserInfoSessioin.BlogUserInfo.Id; userinfobll.Updata(userinftemp, "IsShowMCSS", "IsDisMCSS"); } GetDataHelper.GetAllUser().FirstOrDefault(t => t.Id == BLLSession.UserInfoSessioin.Id).BlogUserInfo = BLLSession.UserInfoSessioin.BlogUserInfo; userinfobll.save(); string path = FileHelper.defaultpath + "/MyConfigure/" + BLLSession.UserInfoSessioin.UserName + "/"; FileHelper.CreatePath(path); if (input.conf_css.Length >= 40000 || input.conf_tail_html.Length >= 40000 || input.conf_first_html.Length >= 40000 || input.conf_side_html.Length >= 40000 || input.conf_js.Length >= 40000) { return("您修改的内容字符过多~"); } if (input.TerminalType == "PC")//如果是PC端 { FileHelper.SaveFile(path, "conf.css", input.conf_css); FileHelper.SaveFile(path, "conf_side.txt", input.conf_side_html); FileHelper.SaveFile(path, "conf_first.txt", input.conf_first_html); FileHelper.SaveFile(path, "conf_tail.txt", input.conf_tail_html); FileHelper.SaveFile(path, "conf.js", input.conf_js); } else { FileHelper.SaveFile(path, "Mconf.css", input.conf_css); FileHelper.SaveFile(path, "Mconf_side.txt", input.conf_side_html); FileHelper.SaveFile(path, "Mconf_first.txt", input.conf_first_html); FileHelper.SaveFile(path, "Mconf_tail.txt", input.conf_tail_html); FileHelper.SaveFile(path, "Mconf.js", input.conf_js); } return("修改成功~"); } catch (Exception ex) { LogSave.ErrLogSave("自定义样式出错", ex); return("修改失败~"); } }
public AxiomEngine() { SetupInput = new ConfigureInput(_setupInput); componentFactory = new AxiomEngineComponentFactory(this); subsystems = new List<IEngineSubsystem>(); }
public ActionResult Configure(ConfigureInput input) { return(Json(adminApplication.Configure(input))); #region MyRegion //var IsShowCSS = Request.Form["IsShowCSS"] == "on"; //var IsDisCSS = Request.Form["IsDisCSS"] == "on"; //if (BLLSession.UserInfoSessioin == null) // return Json("您还没有登录 不能修改~"); ; //try //{ // //============================================================================================================== // //遗留问题: // //如下:如果 userinfobll.Up(BLLSession.UserInfoSessioin.BlogUserInfo)两次的话 报异常:[一个实体对象不能由多个 IEntityChangeTracker 实例引用] // //那么 我只能 new一个新的对象 修改 然后 同时 BLLSession.UserInfoSessioin.BlogUserInfo里面的属性,不然 其他地方访问的话 是没有修改过来的值 // //============================================================================================================== // var userinftemp = new BlogUserInfo(); //BLLSession.UserInfoSessioin.BlogUserInfo; // BLL.BaseBLL<BlogUserInfo> userinfobll = new BaseBLL<BlogUserInfo>(); // if (Request.Form["TerminalType"] == "PC")//如果是PC端 // { // userinftemp.IsShowCSS = // BLLSession.UserInfoSessioin.BlogUserInfo.IsShowCSS = IsShowCSS; // userinftemp.IsDisCSS = // BLLSession.UserInfoSessioin.BlogUserInfo.IsDisCSS = IsDisCSS; // userinftemp.Id = // BLLSession.UserInfoSessioin.BlogUserInfo.Id; // userinfobll.Updata(userinftemp, "IsShowCSS", "IsDisCSS");//"IsShowHTML",, "IsShowJS" // } // else // { // userinftemp.IsShowMCSS = // BLLSession.UserInfoSessioin.BlogUserInfo.IsShowMCSS = IsShowCSS; // userinftemp.IsDisMCSS = // BLLSession.UserInfoSessioin.BlogUserInfo.IsDisMCSS = IsDisCSS; // userinftemp.Id = // BLLSession.UserInfoSessioin.BlogUserInfo.Id; // userinfobll.Updata(userinftemp, "IsShowMCSS", "IsDisMCSS"); // } // CacheData.GetAllUserInfo().FirstOrDefault(t => t.Id == BLLSession.UserInfoSessioin.Id).BlogUserInfo // = BLLSession.UserInfoSessioin.BlogUserInfo; // userinfobll.save(); // string path = FileHelper.defaultpath + "/MyConfigure/" + BLLSession.UserInfoSessioin.UserName + "/"; // FileHelper.CreatePath(path); // if (conf_css.Length >= 40000 || // conf_tail_html.Length >= 40000 || // conf_first_html.Length >= 40000 || // conf_side_html.Length >= 40000 || // conf_js.Length >= 40000) // { // return Json("您修改的内容字符过多~"); // } // if (Request.Form["TerminalType"] == "PC")//如果是PC端 // { // FileHelper.SaveFile(path, "conf.css", conf_css); // FileHelper.SaveFile(path, "conf_side.txt", conf_side_html); // FileHelper.SaveFile(path, "conf_first.txt", conf_first_html); // FileHelper.SaveFile(path, "conf_tail.txt", conf_tail_html); // FileHelper.SaveFile(path, "conf.js", conf_js); // } // else // { // FileHelper.SaveFile(path, "Mconf.css", conf_css); // FileHelper.SaveFile(path, "Mconf_side.txt", conf_side_html); // FileHelper.SaveFile(path, "Mconf_first.txt", conf_first_html); // FileHelper.SaveFile(path, "Mconf_tail.txt", conf_tail_html); // FileHelper.SaveFile(path, "Mconf.js", conf_js); // } // return Json("修改成功~"); //} //catch (Exception ex) //{ // LogSave.ErrLogSave("自定义样式出错", ex); // return Json("修改失败~"); ; //} #endregion }