Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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(); } // 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; 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(); } // 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
- VectorConverter.cs
- CodeGenHelper.cs
- MemberHolder.cs
- RawTextInputReport.cs
- MethodCallConverter.cs
- SequentialUshortCollection.cs
- GrammarBuilderPhrase.cs
- SerializationException.cs
- ToolboxItemFilterAttribute.cs
- TextParaClient.cs
- LicenseException.cs
- Bits.cs
- HttpServerVarsCollection.cs
- AggregationMinMaxHelpers.cs
- XmlStreamStore.cs
- OleDbPermission.cs
- StyleBamlTreeBuilder.cs
- CollectionMarkupSerializer.cs
- grammarelement.cs
- ShaderRenderModeValidation.cs
- XPathSingletonIterator.cs
- WebServiceReceive.cs
- CodeBlockBuilder.cs
- ObjectContext.cs
- FileSecurity.cs
- PeerContact.cs
- StreamInfo.cs
- __TransparentProxy.cs
- EventLogReader.cs
- PipelineDeploymentState.cs
- SystemNetworkInterface.cs
- SHA384Managed.cs
- WindowsFormsHostAutomationPeer.cs
- ApplicationGesture.cs
- PassportPrincipal.cs
- CustomErrorsSectionWrapper.cs
- TreeViewDesigner.cs
- ContentControl.cs
- ReadOnlyCollection.cs
- HttpResponseInternalBase.cs
- ClientSponsor.cs
- SmtpReplyReaderFactory.cs
- PenThreadPool.cs
- RoleManagerModule.cs
- ToolZone.cs
- UniformGrid.cs
- AspProxy.cs
- InputLanguage.cs
- PackageProperties.cs
- MailSettingsSection.cs
- LOSFormatter.cs
- SafeMILHandle.cs
- Metadata.cs
- DesignerActionPanel.cs
- InstanceHandle.cs
- TrackingParameters.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- WindowsMenu.cs
- StreamResourceInfo.cs
- DependencyPropertyDescriptor.cs
- AssemblyContextControlItem.cs
- FrameworkElementAutomationPeer.cs
- DataGridViewSelectedRowCollection.cs
- GridViewSortEventArgs.cs
- SerializationInfoEnumerator.cs
- CodeGenerator.cs
- TextParaClient.cs
- ProbeDuplexAsyncResult.cs
- Matrix.cs
- DelegatingHeader.cs
- MinMaxParagraphWidth.cs
- ObjectDataSource.cs
- SoapFormatExtensions.cs
- SkewTransform.cs
- HijriCalendar.cs
- Registry.cs
- CodeThrowExceptionStatement.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- DrawItemEvent.cs
- PeerCollaborationPermission.cs
- HMACRIPEMD160.cs
- UnknownBitmapEncoder.cs
- AlternationConverter.cs
- DataGridViewCellCancelEventArgs.cs
- EventManager.cs
- PrimitiveXmlSerializers.cs
- MultiPropertyDescriptorGridEntry.cs
- TypeConverterValueSerializer.cs
- AdornerHitTestResult.cs
- GridPattern.cs
- ResourceKey.cs
- SqlUnionizer.cs
- ImageClickEventArgs.cs
- FillBehavior.cs
- SqlBooleanizer.cs
- EntityContainerEntitySet.cs
- MimeParameterWriter.cs
- Helpers.cs
- PointAnimationBase.cs
- ParameterSubsegment.cs