Exemplo n.º 1
0
        private void InitializeCommandAndEvents()
        {
            ConvertCommand = new RelayCommand(p =>
            {
                var result = this.scriptGenerator.GenerateScript(MacroManager.GetCurrentTemplate(), AEActionListViewModel.AEActionList);

                if (result == null)
                {
                    return;
                }

                if (result == true)
                {
                    this.messageBoxService.ShowMessageBox("Done", "Convert", MessageButton.OK, MessageImage.Information, MessageResult.OK);
                }
                else
                {
                    this.messageBoxService.ShowMessageBox("Error. Check your setting or contact me for help", "Convert", MessageButton.OK, MessageImage.Error, MessageResult.OK);
                }
            });

            TestSelectedCommand = new RelayCommand(p =>
            {
                this.scriptGenerator.GenerateScript(MacroManager.GetCurrentTemplate(), aEAction: AEActionListViewModel.GetSelected());
            });

            MacroManager.SelectChanged += (sender, e) =>
            {
                Settings.CustomName = MacroManager.GetCurrentTemplate()?.MacroName;
            };
        }