Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Regex / System / Text / RegularExpressions / CompiledRegexRunnerFactory.cs / 1305376 / CompiledRegexRunnerFactory.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Reflection.Emit; using System.Diagnostics; using System.Security.Permissions; #if !SILVERLIGHT 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(); } #endif // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Reflection.Emit; using System.Diagnostics; using System.Security.Permissions; #if !SILVERLIGHT 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(); } #endif // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ListMarkerSourceInfo.cs
- ValidatorCompatibilityHelper.cs
- FileInfo.cs
- LinearKeyFrames.cs
- PreservationFileWriter.cs
- Decorator.cs
- HtmlTitle.cs
- ReliabilityContractAttribute.cs
- Nodes.cs
- PipeSecurity.cs
- ObjectListShowCommandsEventArgs.cs
- _ListenerResponseStream.cs
- PropertyIDSet.cs
- ListChangedEventArgs.cs
- Header.cs
- JsonReaderDelegator.cs
- SqlRewriteScalarSubqueries.cs
- SQLBoolean.cs
- OdbcTransaction.cs
- ZipIOLocalFileHeader.cs
- OverflowException.cs
- ThemeDirectoryCompiler.cs
- Span.cs
- ValidationPropertyAttribute.cs
- PtsPage.cs
- Fonts.cs
- DummyDataSource.cs
- RSACryptoServiceProvider.cs
- ArrayList.cs
- WSSecurityOneDotOneSendSecurityHeader.cs
- ViewgenGatekeeper.cs
- ProjectionAnalyzer.cs
- ContextStack.cs
- MulticastNotSupportedException.cs
- GridViewUpdateEventArgs.cs
- XmlSchemaSimpleTypeUnion.cs
- StreamAsIStream.cs
- XappLauncher.cs
- FormatterConverter.cs
- TabControl.cs
- WebPartZoneCollection.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- xmlformatgeneratorstatics.cs
- TextTreePropertyUndoUnit.cs
- MaskedTextBoxDesigner.cs
- UriTemplatePathSegment.cs
- MessageSecurityOverTcp.cs
- SecurityContext.cs
- RequiredArgumentAttribute.cs
- FontWeight.cs
- UIInitializationException.cs
- TrustManagerPromptUI.cs
- UIElementIsland.cs
- ExpressionEvaluator.cs
- ProcessThread.cs
- XmlCDATASection.cs
- PrtCap_Base.cs
- Command.cs
- XmlTextReaderImpl.cs
- AnimationStorage.cs
- TableLayoutPanel.cs
- SystemMulticastIPAddressInformation.cs
- DeleteStoreRequest.cs
- GraphicsContainer.cs
- DynamicDocumentPaginator.cs
- HttpCapabilitiesSectionHandler.cs
- RuntimeHandles.cs
- SessionStateModule.cs
- ByteAnimationBase.cs
- PropertyGeneratedEventArgs.cs
- EntryIndex.cs
- DataTemplate.cs
- ClientTargetCollection.cs
- SQLBinary.cs
- LocalValueEnumerator.cs
- PackageDigitalSignatureManager.cs
- QueryAsyncResult.cs
- WebPartZone.cs
- Border.cs
- ContentElementCollection.cs
- PageRouteHandler.cs
- FontCollection.cs
- TextSimpleMarkerProperties.cs
- ImageBrush.cs
- XmlText.cs
- ImageUrlEditor.cs
- HostingPreferredMapPath.cs
- SecurityState.cs
- ClientConvert.cs
- ApplicationTrust.cs
- VisualStyleInformation.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- ListDesigner.cs
- MobileControl.cs
- SafeWaitHandle.cs
- FolderLevelBuildProvider.cs
- ReadOnlyState.cs
- TrackBarRenderer.cs
- BookmarkManager.cs
- OracleConnectionFactory.cs