Пример #1
0
        public void SaveSettings(YakkaSettings settings)
        {
            if (!File.Exists(DatabaseFile))
            {
                CreateDatabase();
            }

            using (IDbConnection connection = GetConnection())
            {
                connection.Open();
                connection.Execute(
                    @"INSERT INTO Settings
                    ([ServerAddress]
                    ,[ServerPort]
                    ,[Username]
                    ,[RememberSettings]
                    ,[ConnectAutomatically]
                    ,[LaunchOnStartup])
                    VALUES
                    (@ServerAddress
                    ,@ServerPort
                    ,@Username
                    ,@RememberSettings
                    ,@ConnectAutomatically
                    ,@LaunchOnStartup)",
                    settings);
            }
        }
Пример #2
0
        public void AcceptButton()
        {
            var setting = new YakkaSettings
            {
                ConnectAutomatically = ConnectAutomatically,
                RememberSettings = RememberSettings,
                LaunchOnStartup = LaunchOnStartup,
                ServerAddress = ServerAddress,
                ServerPort = ServerPort,
                Username = Username
            };

            _vmActor.Tell(new SettingsViewModelActor.SaveSettings(setting.ToImmutable()));
        }