Example #1
0
 private ObservableCollection<ConfigurationOptionsViewModel> Convert(IEnumerable<IConfigurationOptions> options)
 {
     var result = new ObservableCollection<ConfigurationOptionsViewModel>();
     foreach(var option in options)
     {
         var model = new ConfigurationOptionsViewModel();
         model.AbstractBaseName = option.AbstractBaseName;
         model.AssemblyDirectory = option.AssemblyDirectory;
         model.BaseTypeName = option.BaseTypeName;
         model.ConnectionString = option.ConnectionString;
         model.DataNamespace = option.DataNamespace;
         model.EnumNamespace = option.EnumNamespace;
         model.EnumOutputPath = option.EnumOutputPath;
         model.GenerateColumnList = option.GenerateColumnList;
         model.GenerateComments = option.GenerateComments;
         model.IocVerboseLogging = option.IocVerboseLogging;
         model.Namespace = option.Namespace;
         model.OnlyTablesWithPrefix.AddRange(option.OnlyTablesWithPrefix);
         model.OutputPath = option.OutputPath;
         model.SkipTables.AddRange(option.SkipTables);
         model.SkipTablesWithPrefix.AddRange(option.SkipTablesWithPrefix);
         model.StaticPrimaryKeyName = option.StaticPrimaryKeyName;
         model.UseMicrosoftsHeader = option.UseMicrosoftsHeader;
         foreach(var comp in option.Components)
         {
             model.Components.Add(comp);
         }
         foreach(var item in option.EnumReplacements)
         {
             model.EnumReplacements.Add(item.Key, item.Value);
         }
         foreach(var item in option.Enums)
         {
             model.Enums.Add(item);
         }
         result.Add(model);
     }
     return result;
 }
 private void AddButton_Click(object sender, RoutedEventArgs e)
 {
     var model = DataContext as EditConfigsViewModel;
     var newConfig = new ConfigurationOptionsViewModel();
     model.Configs.Add(newConfig);
 }
 public EditConfigControl(ConfigurationOptionsViewModel options)
 {
     InitializeComponent();
     Model = options;
 }