示例#1
0
        public void ResetSettings()
        {
            var setting = new DbBuildingSettings(Settings.Current.Building.BuilderConnectionString);

            setting.Reset();

            var builder = new DbBuilder(Settings.Current.Building.BuilderConnectionString);

            if (Settings.Current.Builder.Id.HasValue)
            {
                builder.Reset(Settings.Current.Builder.Id.Value);
            }
        }
示例#2
0
        void SettingsWindow_Loaded(object sender, RoutedEventArgs e)
        {
            settingsList.Items.Clear();
            var settings = new DbBuildingSettings(Settings.Current.Building.BuilderConnectionString);

            foreach (var reader in settings.GetList())
            {
                var buildingId  = reader.GetInt("BuildingId");
                var source      = new OdbcConnectionStringBuilder(reader.GetString("SourceConnectionString"));
                var destination = new OdbcConnectionStringBuilder(reader.GetString("DestinationConnectionString"));
                var vendor      = reader.GetString("Vendor");

                var title = string.Format("{0}, {1}.{2} → {3}.{4}", vendor, source["server"], source["database"],
                                          destination["server"], destination["database"]);

                settingsList.Items.Add(new KeyValuePair <int, string>(buildingId.Value, title));
            }
        }
 public BuildingSettings(string builderConnectionString)
 {
     dbBuildingSettings      = new DbBuildingSettings(builderConnectionString);
     BuilderConnectionString = builderConnectionString;
 }