コード例 #1
0
 public AcidCodeCompiler(string codetext)
 {
     _codetext          = codetext;
     _isCodeCompiled    = false;
     _compiledCode      = null;
     _compilationErrors = String.Empty;
     _siteSettings      = new GeneralSiteSettings();
 }
コード例 #2
0
        private NewUserWelcomeMailTemplate MapEmailTemplate(AddUserCommand user, GeneralSiteSettings siteSettings)
        {
            var template = new NewUserWelcomeMailTemplate();

            template.FirstName         = user.FirstName;
            template.LastName          = user.LastName;
            template.TemporaryPassword = new HtmlString(user.Password);
            template.ApplicationName   = siteSettings.ApplicationName;

            return(template);
        }
コード例 #3
0
        public ActionResult Index(GeneralSiteSettings generalSiteSettings)
        {
            if (!ModelState.IsValid)
            {
                return(View(new AdministrationViewModel {
                    SiteSettings = generalSiteSettings, SectionName = "settings"
                }));
            }

            _acidRepos.SaveSettings(generalSiteSettings);

            return(View(new AdministrationViewModel {
                SiteSettings = generalSiteSettings, SectionName = "settings", AdminMessage = "Settings saved"
            }));
        }
コード例 #4
0
        public void SaveSettings(GeneralSiteSettings settings)
        {
            settings = settings ?? throw new ArgumentNullException(nameof(settings));

            var dbEntry = _dbContext.GeneralSiteSettings.SingleOrDefault();

            if (dbEntry == null)
            {
                _dbContext.GeneralSiteSettings.Add(settings);
            }
            else
            {
                dbEntry.CompilationTime = settings.CompilationTime;
                dbEntry.RunningTime     = settings.RunningTime;
            }

            _dbContext.SaveChanges();
        }
コード例 #5
0
 public AcidCodeCompiler(string codetext, GeneralSiteSettings siteSettings) : this(codetext)
 {
     _siteSettings = siteSettings ?? throw new ArgumentNullException(nameof(siteSettings));
 }
コード例 #6
0
 public AcidCodeRunner(IAcidCodeCompiler codeCompiler, GeneralSiteSettings siteSettings) : this(codeCompiler)
 {
     _siteSettings = siteSettings ?? throw new ArgumentNullException(nameof(siteSettings));
 }
コード例 #7
0
 public AcidCodeRunner(IAcidCodeCompiler codeCompiler)
 {
     _codeCompiler = codeCompiler ?? throw new ArgumentNullException(nameof(codeCompiler));
     _siteSettings = new GeneralSiteSettings();
 }