Exemple #1
0
        public string GetProgramAlpacaFormData()
        {
            // Build the settings data, convert to JSON, and return it
            var startup = new JsonProgramSettingsStartupOptions()
            {
                startuphostping       = cumulus.ProgramOptions.StartupPingHost,
                startuppingescape     = cumulus.ProgramOptions.StartupPingEscapeTime,
                startupdelay          = cumulus.ProgramOptions.StartupDelaySecs,
                startupdelaymaxuptime = cumulus.ProgramOptions.StartupDelayMaxUptime
            };

            var options = new JsonProgramSettingsGeneralOptions()
            {
                debuglogging       = cumulus.ProgramOptions.DebugLogging,
                datalogging        = cumulus.ProgramOptions.DataLogging,
                stopsecondinstance = cumulus.ProgramOptions.WarnMultiple
            };

            var settings = new JsonProgramSettings()
            {
                startup = startup,
                options = options
            };

            //return JsonConvert.SerializeObject(data);
            return(JsonSerializer.SerializeToString(settings));
        }
        public string GetAlpacaFormData()
        {
            // Build the settings data, convert to JSON, and return it
            var startup = new JsonProgramSettingsStartupOptions()
            {
                startuphostping       = cumulus.ProgramOptions.StartupPingHost,
                startuppingescape     = cumulus.ProgramOptions.StartupPingEscapeTime,
                startupdelay          = cumulus.ProgramOptions.StartupDelaySecs,
                startupdelaymaxuptime = cumulus.ProgramOptions.StartupDelayMaxUptime
            };

            var shutdown = new JsonProgramSettingsShutdownOptions()
            {
                datastoppedexit = cumulus.ProgramOptions.DataStoppedExit,
                datastoppedmins = cumulus.ProgramOptions.DataStoppedMins
            };

            var logging = new JsonProgramSettingsLoggingOptions()
            {
                debuglogging = cumulus.ProgramOptions.DebugLogging,
                datalogging  = cumulus.ProgramOptions.DataLogging,
                ftplogging   = cumulus.FtpOptions.Logging,
                emaillogging = cumulus.SmtpOptions.Logging,
                spikelogging = cumulus.ErrorLogSpikeRemoval
            };

            var options = new JsonProgramSettingsGeneralOptions()
            {
                stopsecondinstance = cumulus.ProgramOptions.WarnMultiple,
                listwebtags        = cumulus.ProgramOptions.ListWebTags
            };

            var culture = new JsonProgramSettingsCultureOptions()
            {
                removespacefromdateseparator = cumulus.ProgramOptions.Culture.RemoveSpaceFromDateSeparator
            };

            var settings = new JsonProgramSettings()
            {
                accessible = cumulus.ProgramOptions.EnableAccessibility,
                startup    = startup,
                shutdown   = shutdown,
                logging    = logging,
                options    = options,
                culture    = culture
            };

            //return JsonConvert.SerializeObject(data);
            return(JsonSerializer.SerializeToString(settings));
        }