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
- HtmlHead.cs
- ToolStripTextBox.cs
- FigureHelper.cs
- PermissionSet.cs
- LinkArea.cs
- RewritingProcessor.cs
- CompensationExtension.cs
- BitStack.cs
- ButtonFlatAdapter.cs
- AsymmetricSecurityProtocolFactory.cs
- WindowsUserNameCachingSecurityTokenAuthenticator.cs
- StandardBindingReliableSessionElement.cs
- ComPersistableTypeElement.cs
- ListView.cs
- DropDownList.cs
- BaseTransportHeaders.cs
- LinkButton.cs
- ExpressionBuilderContext.cs
- Configuration.cs
- DataMemberFieldConverter.cs
- AppliedDeviceFiltersEditor.cs
- RoleGroup.cs
- LocationSectionRecord.cs
- BitmapEffectInput.cs
- BulletedListEventArgs.cs
- WebControlAdapter.cs
- TextParaClient.cs
- TreeNodeMouseHoverEvent.cs
- ItemCollection.cs
- ManipulationCompletedEventArgs.cs
- ElementUtil.cs
- TiffBitmapEncoder.cs
- EntityContainer.cs
- DefaultValueConverter.cs
- ScriptComponentDescriptor.cs
- SqlDataSourceCommandEventArgs.cs
- DataListCommandEventArgs.cs
- DbTransaction.cs
- isolationinterop.cs
- IndicFontClient.cs
- OutOfProcStateClientManager.cs
- SymLanguageType.cs
- DataGrid.cs
- ClientProxyGenerator.cs
- NavigationExpr.cs
- AppSettingsExpressionBuilder.cs
- DbProviderFactories.cs
- Adorner.cs
- PrintPreviewDialog.cs
- SByte.cs
- BamlStream.cs
- HwndProxyElementProvider.cs
- ExpressionServices.cs
- regiisutil.cs
- WebControlToolBoxItem.cs
- Visual3D.cs
- CachedTypeface.cs
- ToolstripProfessionalRenderer.cs
- EncryptedReference.cs
- XmlSchemaGroupRef.cs
- XmlSchemaObjectCollection.cs
- DbRetry.cs
- KeyInstance.cs
- _DigestClient.cs
- Attributes.cs
- FrameworkContentElement.cs
- BamlRecords.cs
- EntityDataSourceStatementEditor.cs
- XmlILModule.cs
- uribuilder.cs
- ObservableCollection.cs
- StandardTransformFactory.cs
- SizeAnimationUsingKeyFrames.cs
- UnicastIPAddressInformationCollection.cs
- FontDialog.cs
- PenThreadWorker.cs
- EncryptedPackage.cs
- FrameworkElementAutomationPeer.cs
- XMLSyntaxException.cs
- ChangeProcessor.cs
- TypeConstant.cs
- SafeIUnknown.cs
- Rights.cs
- BrowserCapabilitiesFactoryBase.cs
- SourceFilter.cs
- Attributes.cs
- ApplicationHost.cs
- Predicate.cs
- ToolStripControlHost.cs
- TimeoutHelper.cs
- ProtocolsSection.cs
- CssStyleCollection.cs
- SiteIdentityPermission.cs
- DefaultValueTypeConverter.cs
- DefaultHttpHandler.cs
- DoWhileDesigner.xaml.cs
- MimeParameter.cs
- Publisher.cs
- MarshalDirectiveException.cs
- NamedPipeHostedTransportConfiguration.cs