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
- TemplateControlCodeDomTreeGenerator.cs
- followingsibling.cs
- DigitalSignatureProvider.cs
- FixedSOMPageConstructor.cs
- TaskDesigner.cs
- Exceptions.cs
- GroupItem.cs
- SafeReversePInvokeHandle.cs
- PublishLicense.cs
- OSFeature.cs
- EntityContainerRelationshipSet.cs
- Filter.cs
- DefaultBindingPropertyAttribute.cs
- Brushes.cs
- storagemappingitemcollection.viewdictionary.cs
- DbParameterCollection.cs
- CustomBindingElementCollection.cs
- MessageQueuePermission.cs
- CodeMemberProperty.cs
- ThemeDirectoryCompiler.cs
- LinqExpressionNormalizer.cs
- ExpressionCopier.cs
- Int64AnimationBase.cs
- FontFamilyConverter.cs
- RoutedCommand.cs
- SourceFilter.cs
- ElementFactory.cs
- NativeWindow.cs
- TableLayoutColumnStyleCollection.cs
- DataGridPageChangedEventArgs.cs
- RectangleF.cs
- PageVisual.cs
- FloaterBaseParagraph.cs
- TextContainerChangedEventArgs.cs
- TreeView.cs
- AssemblyCollection.cs
- BooleanExpr.cs
- GenericPrincipal.cs
- Function.cs
- InkPresenterAutomationPeer.cs
- TagPrefixCollection.cs
- DataContractSet.cs
- TextMarkerSource.cs
- BaseTreeIterator.cs
- CompatibleIComparer.cs
- ToolStripDropDownClosedEventArgs.cs
- DesignerCommandSet.cs
- SqlDataSourceCache.cs
- httpserverutility.cs
- CatalogPart.cs
- DeclarativeCatalogPart.cs
- StyleSheetDesigner.cs
- AdCreatedEventArgs.cs
- ReversePositionQuery.cs
- TableRow.cs
- ObjectListFieldsPage.cs
- TemplateInstanceAttribute.cs
- SignatureConfirmations.cs
- Attribute.cs
- PeerNameRecordCollection.cs
- WebEvents.cs
- safex509handles.cs
- TextEditorDragDrop.cs
- WindowsStatic.cs
- ReceiveSecurityHeaderElementManager.cs
- TrustLevelCollection.cs
- ConfigurationException.cs
- NetPeerTcpBinding.cs
- FaultContext.cs
- DefaultEventAttribute.cs
- MetadataCacheItem.cs
- ResourcePermissionBase.cs
- XmlSchemaGroup.cs
- DocumentViewerHelper.cs
- EpmContentDeSerializerBase.cs
- unitconverter.cs
- SiteIdentityPermission.cs
- DataObject.cs
- WorkflowStateRollbackService.cs
- SamlAction.cs
- ZoneLinkButton.cs
- ColumnMap.cs
- ExchangeUtilities.cs
- DispatcherEventArgs.cs
- SqlDataSourceCommandEventArgs.cs
- OperationAbortedException.cs
- XmlSchemaValidator.cs
- XomlCompiler.cs
- AdornerDecorator.cs
- ECDiffieHellman.cs
- PageAsyncTask.cs
- SwitchElementsCollection.cs
- ComponentChangingEvent.cs
- DynamicArgumentDesigner.xaml.cs
- TraceLevelHelper.cs
- SessionPageStatePersister.cs
- RowCache.cs
- CellRelation.cs
- OAVariantLib.cs
- WinFormsSecurity.cs