Esempio n. 1
0
 public Profile()
 {
     IgnorePaths = new List<string> ();
     CompilerOptions = new List<string> ();
     GlobalReplacements = new ReplacementCollection (ReplacementContext.Global);
     EnumBackingTypeReplacements = new ReplacementCollection (ReplacementContext.EnumBackingType);
 }
Esempio n. 2
0
 /// <summary>
 /// Replace pattern (determined by the configuration files) of in the text
 /// </summary>
 public static string ReplaceValues(this string value)
 {
     if (SiteConfiguration.Current != null)
     {
         ReplacementCollection replacements = SiteConfiguration.Current.Replacements;
         foreach (ReplacementItem item in replacements)
         {
             value = Regex.Replace(value, item.Pattern, item.Replacement, item.RegexOptions);
         }
     }
     return(value);
 }
Esempio n. 3
0
        static void ParseDefine(ReplacementCollection collection, string define, string optionName)
        {
            var split = define.Split (new [] { '=' }, 2);
            if (split.Length < 2)
                throw new OptionException ("invalid define: must be PATTERN=REPLACEMENT", optionName);

            collection.Add (split [0].Trim (), split [1].Trim ());
        }