private void ExecuteOpenModPathManager(object sender, ExecutedRoutedEventArgs e) { ModManager.Show(); }
public UIManager() { MainWindow = new MainWindow(); WaresWindow = new WaresWindow(); ModManager = new ModManager(); m_XmlExtractor = new XmlExtractor(this); m_XmlWriter = new XmlWriter(this); m_ReadWriteConfig = new ReadWriteConfig(this); m_Calculations = new Calculations(this); this.UIModel = new UIModel(); MainWindow.DataContext = this.UIModel; WaresWindow.DataContext = this.UIModel; VanillaXmlFiles = new List <string>(); Mod1XmlFiles = new List <string>(); Mod2XmlFiles = new List <string>(); Mod3XmlFiles = new List <string>(); Mod4XmlFiles = new List <string>(); Mod5XmlFiles = new List <string>(); Mod6XmlFiles = new List <string>(); m_ModFilesReader = new ModFilesReader(this, m_XmlExtractor); MainWindow.Closing += OnClosing; MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.ReadAllVanillaFilesCommand, this.ExecuteReadAllVanillaFilesCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.ReadAllModFilesCommand, this.ExecuteReadAllModFilesCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.OpenModPathManager, this.ExecuteOpenModPathManager)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.FilterCommand, this.ExecuteFilterCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.WriteAllChangedFilesCommand, this.ExecuteWriteAllChangedFilesCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.AddToValueCommand, this.ExecuteAddToValueCommand, CanExecuteCalculate)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.SubstractFromValueCommand, this.ExecuteSubstractFromValueCommand, CanExecuteCalculate)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.MultiplyToValueCommand, this.ExecuteMultiplyToValueCommand, CanExecuteCalculate)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.DivideByValueCommand, this.ExecuteDivideByValueCommand, CanExecuteCalculate)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.SetFixedValueCommand, this.ExecuteSetFixedValueCommand, CanExecuteCalculate)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.ShowWaresWindowCommand, this.ExecuteShowWaresWindowCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.OnMainWindowCellRightClick, this.ExecuteOnMainWindowCellRightClick)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.SelectFolderCommand, this.ExecuteSelectFolderCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod1FolderCommand, this.ExecuteSelectMod1FolderCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod2FolderCommand, this.ExecuteSelectMod2FolderCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.SelectExportFolderCommand, this.ExecuteSelectExportFolderCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.RecalculatePriceCommand, this.ExecuteRecalculatePriceCommand)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.OnWeaponDoubleClick, this.ExecuteOnWeaponDoubleClick)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.OnProjectileDoubleClick, this.ExecuteOnProjectileDoubleClick)); MainWindow.CommandBindings.Add(new CommandBinding(X4Commands.ShowHelp, this.ExecuteShowHelp)); ModManager = new ModManager(); ModManager.DataContext = this.UIModel; ModManager.CommandBindings.Add(new CommandBinding(X4Commands.SelectFolderCommand, this.ExecuteSelectFolderCommand)); ModManager.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod1FolderCommand, this.ExecuteSelectMod1FolderCommand)); ModManager.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod2FolderCommand, this.ExecuteSelectMod2FolderCommand)); ModManager.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod3FolderCommand, this.ExecuteSelectMod3FolderCommand)); ModManager.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod4FolderCommand, this.ExecuteSelectMod4FolderCommand)); ModManager.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod5FolderCommand, this.ExecuteSelectMod5FolderCommand)); ModManager.CommandBindings.Add(new CommandBinding(X4Commands.SelectMod6FolderCommand, this.ExecuteSelectMod6FolderCommand)); ModManager.CommandBindings.Add(new CommandBinding(X4Commands.CloseModPathManager, this.ExecuteCloseModPathManager)); m_ReadWriteConfig.LoadConfig(); this.TextDictionary = new Dictionary <string, string>(); this.TextDictionary = m_XmlExtractor.ReadTextXml(this.UIModel.Path + this.PathToTexts + @"\0001-l044.xml", this.TextDictionary); MainWindow.Show(); this.WaresWindow = new WaresWindow(); this.WaresWindow.Owner = this.MainWindow; this.WaresWindow.DataContext = this.UIModel; this.WaresWindow.CommandBindings.Add(new CommandBinding(X4Commands.OnWaresWindowCellRightClick, this.ExecuteOnWaresWindowCellRightClick)); this.WaresWindow.CommandBindings.Add(new CommandBinding(X4Commands.RecalculatePriceCommand, this.ExecuteRecalculatePriceCommand)); ModManager.Owner = this.MainWindow; WaresWindow.Owner = this.MainWindow; }
private void ExecuteCloseModPathManager(object sender, ExecutedRoutedEventArgs e) { m_ReadWriteConfig.SaveConfig(); ModManager.Hide(); }