예제 #1
0
        /// <summary>
        /// Runs a list of LauncherCommands by name (commands must have been loaded before using LoadCommandSets)
        /// </summary>
        /// <param name="commandSetName">The name of the command set to run</param>
        public async Task RunCommandSet(string commandSetName)
        {
            if (sets.CountSets() == 0)
            {
                throw new InvalidOperationException(Resources.NoCommandSets);
            }

            if (sets.ContainsCommandSet(commandSetName))
            {
                await RunCommandSet(sets.GetCommandSet(commandSetName));
            }
        }
예제 #2
0
 /// <summary>
 /// Loads a list of command sets from a config file (execute command sets with RunCommandSet)
 /// </summary>
 /// <param name="configFileLines">The lines of the config file (after loading the file with File.ReadAllLines)</param>
 /// <returns>True if at least one command set was loaded</returns>
 public bool LoadCommandSets(string[] configFileLines)
 {
     sets = ConfigReader.Read(configFileLines);
     return(sets.CountSets() > 0);
 }
예제 #3
0
 /// <summary>
 /// Loads a list of command sets from a config file (execute command sets with RunCommandSet)
 /// </summary>
 /// <param name="pathToConfigFile">Complete path to the config file</param>
 /// <returns>True if at least one command set was loaded</returns>
 public bool LoadCommandSets(string pathToConfigFile)
 {
     sets = ConfigReader.Read(pathToConfigFile);
     return(sets.CountSets() > 0);
 }