ComposeSettings() public static method

public static ComposeSettings ( ShellSettings settings ) : string
settings ShellSettings
return string
        void IShellSettingsManager.SaveSettings(ShellSettings settings)
        {
            if (settings == null)
            {
                Logger.Error("shell settings is null");
                throw new ArgumentNullException("settings");
            }

            Logger.Debug("Saving ShellSettings");
            var filePath = Path.Combine(Path.Combine("Sites", settings.Name), _settingsFileName);

            _appDataFolder.CreateFile(filePath, ShellSettingsSerializer.ComposeSettings(settings));
            Logger.Information("ShellSettings saved successfully; ");
            _events.Saved(settings);
        }
        void IShellSettingsManager.SaveSettings(ShellSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentException(T("There are no settings to save.").ToString());
            }
            if (string.IsNullOrEmpty(settings.Name))
            {
                throw new ArgumentException(T("Settings \"Name\" is not set.").ToString());
            }

            var filePath = Path.Combine(Path.Combine("Sites", settings.Name), "Settings.txt");

            _appDataFolder.CreateFile(filePath, ShellSettingsSerializer.ComposeSettings(settings));
            _events.Saved(settings);
        }
Beispiel #3
0
        void IShellSettingsManager.SaveSettings(ShellSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (String.IsNullOrEmpty(settings.Name))
            {
                throw new ArgumentException("The Name property of the supplied ShellSettings object is null or empty; the settings cannot be saved.", "settings");
            }

            Logger.Debug("Saving ShellSettings for tenant '{0}'...", settings.Name);
            var filePath = Path.Combine(Path.Combine("Sites", settings.Name), _settingsFileName);

            _appDataFolder.CreateFile(filePath, ShellSettingsSerializer.ComposeSettings(settings));

            Logger.Debug("ShellSettings saved successfully; flagging tenant '{0}' for restart.", settings.Name);
            _events.Saved(settings);
        }