Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Regex / System / Text / RegularExpressions / CompiledRegexRunnerFactory.cs / 1 / CompiledRegexRunnerFactory.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Reflection.Emit;
using System.Diagnostics;
using System.Security.Permissions;
namespace System.Text.RegularExpressions {
internal sealed class CompiledRegexRunnerFactory : RegexRunnerFactory {
DynamicMethod goMethod;
DynamicMethod findFirstCharMethod;
DynamicMethod initTrackCountMethod;
internal CompiledRegexRunnerFactory (DynamicMethod go, DynamicMethod firstChar, DynamicMethod trackCount) {
this.goMethod = go;
this.findFirstCharMethod = firstChar;
this.initTrackCountMethod = trackCount;
//Debug.Assert(goMethod != null && findFirstCharMethod != null && initTrackCountMethod != null, "can't be null");
}
protected internal override RegexRunner CreateInstance() {
CompiledRegexRunner runner = new CompiledRegexRunner();
new ReflectionPermission(PermissionState.Unrestricted).Assert();
runner.SetDelegates((NoParamDelegate) goMethod.CreateDelegate(typeof(NoParamDelegate)),
(FindFirstCharDelegate) findFirstCharMethod.CreateDelegate(typeof(FindFirstCharDelegate)),
(NoParamDelegate) initTrackCountMethod.CreateDelegate(typeof(NoParamDelegate)));
return runner;
}
}
internal delegate RegexRunner CreateInstanceDelegate();
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MimeFormReflector.cs
- WmfPlaceableFileHeader.cs
- UnsafeNativeMethods.cs
- SuppressIldasmAttribute.cs
- MouseEventArgs.cs
- graph.cs
- HttpClientProtocol.cs
- SmiEventSink_DeferedProcessing.cs
- CoreSwitches.cs
- PolicyLevel.cs
- GlyphRunDrawing.cs
- DPCustomTypeDescriptor.cs
- ArgumentsParser.cs
- documentation.cs
- TextWriter.cs
- ContentPresenter.cs
- Transform3DGroup.cs
- ModuleBuilder.cs
- DataGridParentRows.cs
- SqlInternalConnection.cs
- ListInitExpression.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- InkPresenter.cs
- IsolatedStorageFilePermission.cs
- HyperLinkField.cs
- HttpClientChannel.cs
- coordinator.cs
- CompilationUtil.cs
- DataGridViewCellFormattingEventArgs.cs
- XmlBindingWorker.cs
- Input.cs
- ReferencedAssembly.cs
- SqlProviderServices.cs
- TcpActivation.cs
- SoapSchemaExporter.cs
- TypeConverterAttribute.cs
- Matrix3D.cs
- AdRotator.cs
- UrlMappingsModule.cs
- InternalTypeHelper.cs
- Span.cs
- ListView.cs
- ClientBuildManager.cs
- WsatExtendedInformation.cs
- _NtlmClient.cs
- EmptyEnumerable.cs
- InheritanceContextChangedEventManager.cs
- XmlEncodedRawTextWriter.cs
- ProjectedWrapper.cs
- DiagnosticsConfiguration.cs
- ResXResourceWriter.cs
- FormViewPagerRow.cs
- AuthenticationModulesSection.cs
- DependencyPropertyAttribute.cs
- DataGridViewColumnStateChangedEventArgs.cs
- FixedPosition.cs
- DataFormat.cs
- ValuePatternIdentifiers.cs
- ToolStripProgressBar.cs
- connectionpool.cs
- PolyLineSegment.cs
- XmlAnyElementAttribute.cs
- DataSetMappper.cs
- FieldMetadata.cs
- MessageHeader.cs
- StandardToolWindows.cs
- FigureParaClient.cs
- JsonStringDataContract.cs
- TypeDependencyAttribute.cs
- MatrixCamera.cs
- TypedElement.cs
- QilNode.cs
- FormsAuthentication.cs
- DesignUtil.cs
- StoragePropertyMapping.cs
- TransformCollection.cs
- iisPickupDirectory.cs
- AsmxEndpointPickerExtension.cs
- CommandManager.cs
- DetailsViewModeEventArgs.cs
- Types.cs
- DataFormats.cs
- ZoneButton.cs
- TableLayoutSettings.cs
- CodeAttributeDeclaration.cs
- DataMisalignedException.cs
- ShaderRenderModeValidation.cs
- IndexerNameAttribute.cs
- ToolStripGrip.cs
- ThreadInterruptedException.cs
- GridLengthConverter.cs
- querybuilder.cs
- DelayLoadType.cs
- DateTimeFormat.cs
- MulticastIPAddressInformationCollection.cs
- CompiledQuery.cs
- EUCJPEncoding.cs
- SqlDataAdapter.cs
- ServiceInfo.cs
- DataGridItemCollection.cs