Beispiel #1
0
        /// <summary></summary>
        protected CompiledRegex(CompiledRegexList list, RegexOptions options, TimeSpan matchTimeout)
        {
            if (!options.HasFlag(RegexOptions.Compiled))
            {
                options |= RegexOptions.Compiled;
            }

            List <Assembly> lst = new List <Assembly>();

            foreach (var item in list)
            {
                Items.Add(new CompiledRegexClass(item, options, matchTimeout));
            }

            SourceAssembly = Items.Last().GetType().Assembly;
        }
Beispiel #2
0
        /// <summary>
        /// Compile a <see cref="CompiledRegexList"/> into a Assembly file (.dll)
        /// </summary>
        /// <param name="assemblyName"></param>
        /// <param name="list"></param>
        /// <param name="options"></param>
        /// <param name="matchTimeout"></param>
        /// <returns></returns>
        static public CompiledRegex CompileToAssembly(AssemblyName assemblyName, CompiledRegexList list, RegexOptions options, TimeSpan matchTimeout)
        {
            if (list == null)
            {
                throw new ArgumentNullException(nameof(list));
            }
            if (list.Count == 0)
            {
                throw new ArgumentException("The input list must have at least one entry.", nameof(list));
            }

            if (options.HasFlag(RegexOptions.Compiled))
            {
                options ^= RegexOptions.Compiled;
            }

            return(CompileToAssembly(assemblyName, Convert(list, options, matchTimeout)));
        }
Beispiel #3
0
 /// <summary>
 /// Compile a <see cref="CompiledRegexList"/> into a Assembly file (.dll)
 /// </summary>
 /// <param name="name"></param>
 /// <param name="list"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 static public CompiledRegex CompileToAssembly(string name, CompiledRegexList list, RegexOptions options)
 {
     return(CompileToAssembly(name, list, options, RegexHelper.Timeout));
 }
Beispiel #4
0
 /// <summary>
 /// Compile a <see cref="CompiledRegexList"/> into a <see cref="RuntimeAssembly"/>
 /// </summary>
 /// <param name="list"></param>
 /// <param name="options"></param>
 /// <param name="matchTimeout"></param>
 /// <returns></returns>
 static public CompiledRegex CompileToRuntime(CompiledRegexList list, RegexOptions options, TimeSpan matchTimeout)
 {
     return(new CompiledRegex(list, options, matchTimeout));
 }
Beispiel #5
0
 /// <summary>
 /// Compile a <see cref="CompiledRegexList"/> into a <see cref="RuntimeAssembly"/>
 /// </summary>
 /// <param name="list"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 static public CompiledRegex CompileToRuntime(CompiledRegexList list, RegexOptions options)
 {
     return(CompileToRuntime(list, options, RegexHelper.Timeout));
 }
Beispiel #6
0
 /// <summary>
 /// Compile a <see cref="CompiledRegexList"/> into a <see cref="RuntimeAssembly"/>
 /// </summary>
 /// <param name="list"></param>
 /// <returns></returns>
 static public CompiledRegex CompileToRuntime(CompiledRegexList list)
 {
     return(CompileToRuntime(list, RegexHelper.RegexOptions));
 }