public string Get(ModificationHistorySettings settings, string input)
        {
            var output = settings.OutputPattern;

            if ((settings != null) && !String.IsNullOrEmpty(input))
            {
                foreach (Match match in Regex.Matches(input, settings.InputPattern, RegexOptions.IgnoreCase))
                {
                    output = output.Replace("DATE", DateTime.Today.ToString(settings.DateFormat));
                    output = output.Replace("NAME", settings.Name);
                    output = output.Replace("ID", match.Groups[1]?.Value ?? String.Empty);
                    output = output.Replace("TEXT", match.Groups[2]?.Value ?? String.Empty);
                }

                output = RemoveDiacritics(output);
            }

            return(output);
        }
 public ModificationHistoryFile(ModificationHistorySettings settings, string path, string modificationHistory)
 {
     Settings            = settings;
     Path                = path;
     ModificationHistory = modificationHistory;
 }
Exemplo n.º 3
0
 public void SetSettings()
 {
     ActualSettings = new ModificationHistorySettings();
     PropertyGrid.SelectedObject = ActualSettings;
 }