public string GenCommandLine(bool showEncoding)
 {
     return(CommandLineUtils.GenerateCommandLine(Dir, FileMask, ExcludeFileMask, IncludeSubDirectories, IsCaseSensitive,
                                                 FindTextHasRegEx, SkipBinaryFileDetection, showEncoding,
                                                 IncludeFilesWithoutMatches, UseEscapeChars, AlwaysUseEncoding, FindText,
                                                 ReplaceText));
 }
Exemple #2
0
 public static string GenerateCommandLine(
     string dir,
     string fileMask,
     string excludeFileMask,
     bool includeSubDirectories,
     bool isCaseSensitive,
     bool isRegEx,
     bool skipBinaryFileDetection,
     bool showEncoding,
     bool includeFilesWithoutMatches,
     bool useEscapeChars,
     Encoding encoding,
     string find,
     string replace)
 {
     return
         (String.Format(
              "--cl --dir \"{0}\" --fileMask \"{1}\"{2}{3}{4}{5}{6}{7}{8}{9}{10} --find \"{11}\" {12}",
              dir.TrimEnd('\\'),
              fileMask,
              String.IsNullOrEmpty(excludeFileMask)
                                         ? ""
                                         : String.Format(" --excludeFileMask \"{0}\"", CommandLineUtils.EncodeText(excludeFileMask)),
              includeSubDirectories ? " --includeSubDirectories" : "",
              isCaseSensitive ? " --caseSensitive" : "",
              isRegEx ? " --useRegEx" : "",
              skipBinaryFileDetection ? " --skipBinaryFileDetection" : "",
              showEncoding ? " --showEncoding" : "",
              includeFilesWithoutMatches ? " --includeFilesWithoutMatches" : "",
              useEscapeChars ? " --useEscapeChars" : "",
              (encoding != null) ? String.Format(" --alwaysUseEncoding \"{0}\"", encoding.HeaderName) : "",
              CommandLineUtils.EncodeText(find, isRegEx, useEscapeChars),
              (replace != null) ? String.Format("--replace \"{0}\"", CommandLineUtils.EncodeText(replace, false, useEscapeChars)) : ""
              ));
 }