Exemple #1
0
 public ReplaceOptions(
     MatchEvaluator matchEvaluator,
     ReplaceFunctions functions = ReplaceFunctions.None,
     bool cultureInvariant      = false)
 {
     MatchEvaluator   = matchEvaluator ?? throw new ArgumentNullException(nameof(matchEvaluator));
     Functions        = functions;
     CultureInvariant = cultureInvariant;
 }
Exemple #2
0
 public ReplaceOptions(
     string?replacement,
     ReplaceFunctions functions = ReplaceFunctions.None,
     bool cultureInvariant      = false)
 {
     Replacement      = replacement ?? "";
     Functions        = functions;
     CultureInvariant = cultureInvariant;
 }
Exemple #3
0
 public RenameOptions(
     string replacement,
     ReplaceFunctions functions            = ReplaceFunctions.None,
     bool cultureInvariant                 = false,
     ConflictResolution conflictResolution = ConflictResolution.Skip)
     : base(replacement, functions, cultureInvariant)
 {
     ConflictResolution = conflictResolution;
 }
Exemple #4
0
 public RenameOptions(
     MatchEvaluator matchEvaluator,
     ReplaceFunctions functions            = ReplaceFunctions.None,
     bool cultureInvariant                 = false,
     ConflictResolution conflictResolution = ConflictResolution.Skip)
     : base(matchEvaluator, functions, cultureInvariant)
 {
     ConflictResolution = conflictResolution;
 }
Exemple #5
0
        public ReplaceOptions(
            string replacement            = null,
            MatchEvaluator matchEvaluator = null,
            ReplaceFunctions functions    = ReplaceFunctions.None,
            bool cultureInvariant         = false)
        {
            Replacement    = replacement;
            MatchEvaluator = matchEvaluator;

            if (MatchEvaluator == null)
            {
                if (replacement != null ||
                    functions == ReplaceFunctions.None)
                {
                    replacement ??= "";

                    MatchEvaluator = new MatchEvaluator(match => match.Result(replacement));
                }
            }

            Functions        = functions;
            CultureInvariant = cultureInvariant;
        }