Beispiel #1
0
 public string GenCommandLine(bool showEncoding)
 {
     return(CommandLineUtils.GenerateCommandLine(Dir, FileMask, ExcludeFileMask, ExcludeDir, IncludeSubDirectories, IsCaseSensitive,
                                                 FindTextHasRegEx, SkipBinaryFileDetection, showEncoding,
                                                 IncludeFilesWithoutMatches, UseEscapeChars, AlwaysUseEncoding, FindText,
                                                 null, IsKeepModifiedDate));
 }
 public static string GenerateCommandLine(
     string dir,
     string fileMask,
     string excludeFileMask,
     string excludeDir,
     bool includeSubDirectories,
     bool isCaseSensitive,
     bool isRegEx,
     bool skipBinaryFileDetection,
     bool showEncoding,
     bool includeFilesWithoutMatches,
     bool useEscapeChars,
     Encoding encoding,
     string find,
     string replace,
     bool IsKeepModifiedDate)
 {
     return
         (String.Format(
              "--cl --dir \"{0}\" --fileMask \"{1}\"{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12} --find \"{13}\" {14}",
              dir.TrimEnd('\\'),
              fileMask,
              String.IsNullOrEmpty(excludeFileMask)
                 ? ""
                 : String.Format(" --excludeFileMask \"{0}\"", CommandLineUtils.EncodeText(excludeFileMask)),
              String.IsNullOrEmpty(excludeDir)
                 ? ""
                 : String.Format(" --ExcludeDir \"{0}\"", CommandLineUtils.EncodeText(excludeDir)),
              includeSubDirectories ? " --includeSubDirectories" : "",
              isCaseSensitive ? " --caseSensitive" : "",
              isRegEx ? " --useRegEx" : "",
              IsKeepModifiedDate ? " --KeepModifiedDate" : "",
              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)) : ""
              ));
 }