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
- SiteMap.cs
- StrongNameKeyPair.cs
- UrlPath.cs
- DisableDpiAwarenessAttribute.cs
- NumberFormatInfo.cs
- webbrowsersite.cs
- SqlComparer.cs
- NetPipeSectionData.cs
- TdsParserSessionPool.cs
- IISMapPath.cs
- FacetDescriptionElement.cs
- ContactManager.cs
- _LocalDataStoreMgr.cs
- DefaultShape.cs
- ConfigXmlSignificantWhitespace.cs
- IntPtr.cs
- ImageField.cs
- MessageDirection.cs
- TCEAdapterGenerator.cs
- DrawingContextWalker.cs
- RequestUriProcessor.cs
- SqlConnectionHelper.cs
- OpenTypeLayoutCache.cs
- RNGCryptoServiceProvider.cs
- PersianCalendar.cs
- SamlNameIdentifierClaimResource.cs
- Knowncolors.cs
- TextPenaltyModule.cs
- Sql8ExpressionRewriter.cs
- LocalValueEnumerator.cs
- ObjectDataSourceSelectingEventArgs.cs
- MissingSatelliteAssemblyException.cs
- WasHttpModulesInstallComponent.cs
- DataSourceHelper.cs
- SqlNode.cs
- SmtpLoginAuthenticationModule.cs
- BooleanSwitch.cs
- Odbc32.cs
- XmlAnyAttributeAttribute.cs
- SimpleWebHandlerParser.cs
- ByteAnimation.cs
- CompositeClientFormatter.cs
- SiteMapNode.cs
- MarkupCompilePass2.cs
- VolatileEnlistmentMultiplexing.cs
- Symbol.cs
- XmlSchemaComplexContentExtension.cs
- ImageSourceConverter.cs
- DialogResultConverter.cs
- BroadcastEventHelper.cs
- SByteStorage.cs
- ellipse.cs
- DesignTimeParseData.cs
- FileLogRecordHeader.cs
- PageAdapter.cs
- EncodingTable.cs
- EventLog.cs
- ConfigXmlSignificantWhitespace.cs
- GenericUriParser.cs
- PackageRelationshipSelector.cs
- EntityDataSourceContainerNameItem.cs
- GeometryValueSerializer.cs
- ObjectCacheHost.cs
- UpdateException.cs
- SymbolEqualComparer.cs
- XsdValidatingReader.cs
- InputScope.cs
- WindowShowOrOpenTracker.cs
- DefinitionUpdate.cs
- StylusPlugin.cs
- ToolStripMenuItemDesigner.cs
- ContextMenuStrip.cs
- AnnouncementEndpointElement.cs
- SafeHandle.cs
- ContractBase.cs
- FixUpCollection.cs
- ObjectDataSource.cs
- DataSvcMapFile.cs
- DbParameterCollection.cs
- FontUnitConverter.cs
- TableLayoutPanel.cs
- LocalFileSettingsProvider.cs
- LingerOption.cs
- _FtpDataStream.cs
- OletxEnlistment.cs
- PasswordTextNavigator.cs
- QueryPageSettingsEventArgs.cs
- AbsoluteQuery.cs
- WebPartVerb.cs
- SurrogateDataContract.cs
- TreeNodeStyleCollection.cs
- SafeFileMappingHandle.cs
- httpapplicationstate.cs
- DataBindEngine.cs
- ModuleBuilderData.cs
- PropertyPathWorker.cs
- ManualResetEvent.cs
- DataObjectMethodAttribute.cs
- FixedDocument.cs
- RoleManagerEventArgs.cs