Пример #1
0
        static void InvokeCommand(ICakeContext context, string command, ResourceHackerSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            var runner = new ResourceHackerTool(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);

            runner.Run(command, settings);
        }
 /// <summary>
 /// Appends all arguments from <paramref name="settings"/> and <paramref name="arguments"/>.
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="command"></param>
 /// <param name="settings">The settings.</param>
 /// <param name="arguments"></param>
 public static void AppendAll(this ProcessArgumentBuilder builder, ICakeEnvironment cakeEnvironment, string command, ResourceHackerSettings settings)
 {
     if (builder == null)
     {
         throw new ArgumentNullException("builder");
     }
     if (string.IsNullOrEmpty(command))
     {
         throw new ArgumentNullException("command");
     }
     if (settings == null)
     {
         settings = new ResourceHackerSettings();
     }
     builder.Append($"-{command}");
     AppendArguments(builder, cakeEnvironment, settings);
 }
Пример #3
0
 public static void ResourceHackerChangeLanguage(this ICakeContext context, string languageId, ResourceHackerSettings settings)
 {
     if (string.IsNullOrEmpty(languageId))
     {
         throw new ArgumentNullException(nameof(languageId));
     }
     InvokeCommand(context, $"changelanguage({languageId})", settings);
 }
Пример #4
0
 public static void ResourceHackerModify(this ICakeContext context, ResourceHackerSettings settings)
 {
     InvokeCommand(context, "modify", settings);
 }
Пример #5
0
 public static void ResourceHackerExtract(this ICakeContext context, ResourceHackerSettings settings)
 {
     InvokeCommand(context, "extract", settings);
 }
Пример #6
0
 public static void ResourceHackerDelete(this ICakeContext context, ResourceHackerSettings settings)
 {
     InvokeCommand(context, "delete", settings);
 }
Пример #7
0
 public static void ResourceHackerCompile(this ICakeContext context, ResourceHackerSettings settings)
 {
     InvokeCommand(context, "compile", settings);
 }
Пример #8
0
 public static void ResourceHackerAddSkip(this ICakeContext context, ResourceHackerSettings settings)
 {
     InvokeCommand(context, "addskip", settings);
 }
Пример #9
0
 public static void ResourceHackerAddOverwrite(this ICakeContext context, ResourceHackerSettings settings)
 {
     InvokeCommand(context, "addoverwrite", settings);
 }
 /// <summary>
 /// Appends pre or post command arguments.
 /// </summary>
 /// <typeparam name="TSettings"></typeparam>
 /// <param name="builder"></param>
 /// <param name="settings"></param>
 /// <param name="preCommand"></param>
 public static void AppendArguments(ProcessArgumentBuilder builder, ICakeEnvironment cakeEnvironment, ResourceHackerSettings settings)
 {
     AppendFilePathIfNotNull(builder, cakeEnvironment, "open", settings.Open);
     AppendFilePathIfNotNull(builder, cakeEnvironment, "save", settings.Save);
     AppendFilePathIfNotNull(builder, cakeEnvironment, "log", settings.Log);
     AppendFilePathIfNotNull(builder, cakeEnvironment, "resource", settings.Resource);
     AppendFilePathIfNotNull(builder, cakeEnvironment, "script", settings.Script);
     if (settings.Mask.HasValue)
     {
         var mask = settings.Mask.Value;
         builder.Append($"-mask {mask.Type},{mask.Name},{mask.Language}");
     }
 }