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
- HtmlInputReset.cs
- EventToken.cs
- IISUnsafeMethods.cs
- Clause.cs
- PermissionRequestEvidence.cs
- TransportConfigurationTypeElement.cs
- EntityWrapperFactory.cs
- UrlPath.cs
- ScriptResourceMapping.cs
- ExpandSegmentCollection.cs
- LowerCaseStringConverter.cs
- EntityDataSourceReferenceGroup.cs
- WindowsListBox.cs
- GlyphRun.cs
- DataBoundLiteralControl.cs
- XmlLinkedNode.cs
- WebPartZoneBase.cs
- CacheDependency.cs
- RuleAttributes.cs
- RuntimeComponentFilter.cs
- SmtpNegotiateAuthenticationModule.cs
- FtpWebResponse.cs
- SoapHeaderAttribute.cs
- InkCollectionBehavior.cs
- WmlPanelAdapter.cs
- Pkcs7Signer.cs
- XmlNullResolver.cs
- Validator.cs
- PassportAuthenticationEventArgs.cs
- AsyncResult.cs
- ReliableDuplexSessionChannel.cs
- StyleSelector.cs
- InfoCardKeyedHashAlgorithm.cs
- CodeObjectCreateExpression.cs
- DecoderExceptionFallback.cs
- Parameter.cs
- PropertyNames.cs
- NamespaceListProperty.cs
- CatalogPartCollection.cs
- keycontainerpermission.cs
- Utils.cs
- Win32.cs
- SafeNativeMethodsMilCoreApi.cs
- PhysicalAddress.cs
- propertytag.cs
- TreeWalkHelper.cs
- TemplateNameScope.cs
- SqlMetaData.cs
- CalendarButtonAutomationPeer.cs
- XPathException.cs
- DocumentPage.cs
- ListItem.cs
- DBPropSet.cs
- ConversionHelper.cs
- ProcessHost.cs
- ObjectHelper.cs
- AutomationIdentifierGuids.cs
- CorrelationToken.cs
- UnSafeCharBuffer.cs
- XmlElement.cs
- EtwTrackingBehaviorElement.cs
- HtmlTableCellCollection.cs
- ConfigXmlAttribute.cs
- CapiSymmetricAlgorithm.cs
- SqlDataSourceSelectingEventArgs.cs
- XmlSchemaComplexContent.cs
- OwnerDrawPropertyBag.cs
- XamlTypeMapper.cs
- FunctionQuery.cs
- DependencyObjectPropertyDescriptor.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- QuotedPrintableStream.cs
- ProfilePropertySettingsCollection.cs
- SetterBaseCollection.cs
- WebPart.cs
- HttpModuleCollection.cs
- RenderData.cs
- ListDependantCardsRequest.cs
- AttachmentService.cs
- ToolStripLabel.cs
- PKCS1MaskGenerationMethod.cs
- StrongName.cs
- HttpRequest.cs
- ValidatingReaderNodeData.cs
- DataKey.cs
- View.cs
- RequiredFieldValidator.cs
- TypeExtensions.cs
- XmlCharacterData.cs
- MimeBasePart.cs
- SoapFormatter.cs
- XmlQueryContext.cs
- Descriptor.cs
- WSFederationHttpBindingElement.cs
- DictionaryContent.cs
- Debug.cs
- RetrieveVirtualItemEventArgs.cs
- TypeRefElement.cs
- TimeoutValidationAttribute.cs
- XmlSchemaSimpleContent.cs