System.Text.RegularExpressions.Regex.CompileToAssembly Method

Compiles one or more specified System.Text.RegularExpressions.Regex objects and a specified resource file to a named assembly with the specified attributes.

Syntax

[System.MonoTODO]
public static void CompileToAssembly (RegexCompilationInfo[] regexes, System.Reflection.AssemblyName aname, System.Reflection.Emit.CustomAttributeBuilder[] attribs, string resourceFile)

Parameters

regexes
Documentation for this section has not yet been entered.
aname
Documentation for this section has not yet been entered.
attribs
Documentation for this section has not yet been entered.
resourceFile
The name of the Win32 resource file to include in the assembly.

Remarks

The Regex.CompileToAssembly(RegexCompilationInfo[], System.Reflection.AssemblyName, System.Reflection.Emit.CustomAttributeBuilder[], string) method generates a .NET Framework assembly in which each regular expression defined in the regexinfos array is represented by a class. Typically, the Regex.CompileToAssembly(RegexCompilationInfo[], System.Reflection.AssemblyName, System.Reflection.Emit.CustomAttributeBuilder[], string) method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics:

Ordinarily, the code that instantiates and uses the compiled regular expression is found in an assembly or application that is separate from the code that creates the assembly.

Because the erload:System.Text.RegularExpressions.Regex.CompileToAssembly method generates a .NET Framework assembly from a method call instead of using a particular language's class definition keyword (such as class in C# or Class…End Class in Visual Basic), it does not allow .NET Framework attributes to be assigned to the assembly by using the development language's standard attribute syntax. The attributes parameter provides an alternative method for defining the attributes that apply to the assembly. For each attribute that you want to apply to the assembly, do the following:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

You can then pass an array of these System.Reflection.Emit.CustomAttributeBuilder objects instead of the attributes parameter to the Regex.CompileToAssembly(RegexCompilationInfo[], System.Reflection.AssemblyName, System.Reflection.Emit.CustomAttributeBuilder[], string) method.

Requirements

Namespace: System.Text.RegularExpressions
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0