Exemple #1
0
        /// <summary>
        /// Generate script for the selected AEaction only
        /// </summary>
        /// <param name="macro">The macro template</param>
        /// <param name="aEActionList">the aeaction to generate script</param>
        /// <returns></returns>
        public bool?GenerateScript(MacroTemplate macro, IAEActionViewModel aEAction)
        {
            if (!ApplyConvertSetting(macro))
            {
                return(false);
            }

            var actionList = ScaleActionsToMacroResolution(macro, aEAction.UserChoicesToActionList());

            var script = this.emulatorToScriptFactory.GetEmulatorScriptGenerator(setting.SelectedEmulator).MacroToScript(actionList);

            return(scriptApplyFactory.GetScriptApplier(setting.SelectedEmulator).ApplyScriptTo(string.IsNullOrEmpty(setting.CustomName) ? macro.MacroName + "_Test" : setting.CustomName + "_Test", setting.SelectedPath, script, false));
        }
        /// <summary>
        /// Generate script for the selected AEaction only
        /// </summary>
        /// <param name="macro">The macro template</param>
        /// <param name="aEActionList">the aeaction to generate script</param>
        /// <returns></returns>
        public bool?GenerateScript(MacroTemplate macro, IAEActionViewModel aEAction)
        {
            var timer = 200;

            if (!ApplyConvertSetting(macro))
            {
                return(false);
            }

            var actionList = ScaleActionsToMacroResolution(macro, aEAction.UserChoicesToActionList());

            var script = new StringBuilder();

            foreach (var action in actionList)
            {
                script.Append(action.GenerateAction(ref timer));
            }

            return(scriptApplyFactory.GetScriptApplier(setting.SelectedEmulator).ApplyScriptTo(string.IsNullOrEmpty(setting.CustomName) ? macro.MacroName + "_Test": setting.CustomName + "_Test", setting.SelectedPath, script, false));
        }