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
- EventHandlersStore.cs
- DataGridViewBand.cs
- DependencyObjectPropertyDescriptor.cs
- DynamicArgumentDialog.cs
- StreamAsIStream.cs
- EncoderParameter.cs
- HScrollProperties.cs
- DomainConstraint.cs
- ReflectionServiceProvider.cs
- CodeStatement.cs
- ObjectQueryProvider.cs
- IfJoinedCondition.cs
- ResourcesBuildProvider.cs
- XsltOutput.cs
- NumberSubstitution.cs
- TemplateField.cs
- translator.cs
- _OverlappedAsyncResult.cs
- ObjectContext.cs
- EventTrigger.cs
- WindowsListViewGroup.cs
- LocalValueEnumerator.cs
- SqlPersonalizationProvider.cs
- PropertyChangeTracker.cs
- DetailsViewRow.cs
- ListBoxAutomationPeer.cs
- XPathScanner.cs
- ItemAutomationPeer.cs
- EntityContainerEntitySet.cs
- StreamReader.cs
- GenericUriParser.cs
- WebScriptEnablingElement.cs
- CheckBoxStandardAdapter.cs
- LinqDataSourceStatusEventArgs.cs
- BitmapEffectDrawingContent.cs
- ObfuscateAssemblyAttribute.cs
- HtmlTable.cs
- AssemblyNameProxy.cs
- X509CertificateCollection.cs
- MouseBinding.cs
- DataGridViewCheckBoxColumn.cs
- XmlReader.cs
- MultitargetingHelpers.cs
- EnumConverter.cs
- TreeNodeBindingCollection.cs
- ToolStripItemEventArgs.cs
- ToolStripItemBehavior.cs
- ActivityPreviewDesigner.cs
- SqlDataSourceEnumerator.cs
- SqlParameterizer.cs
- SafeIUnknown.cs
- DialogWindow.cs
- CollectionExtensions.cs
- InfoCardSymmetricCrypto.cs
- Baml2006ReaderFrame.cs
- sitestring.cs
- BinaryObjectInfo.cs
- EntityReference.cs
- DataGridCell.cs
- PathTooLongException.cs
- ListViewTableCell.cs
- Rectangle.cs
- DoubleLinkList.cs
- BackgroundFormatInfo.cs
- ProcessHostMapPath.cs
- KnownAssemblyEntry.cs
- Rotation3D.cs
- ConfigurationSettings.cs
- ConnectionStringsExpressionBuilder.cs
- WriteFileContext.cs
- PersonalizationProviderCollection.cs
- TransactionManager.cs
- TextDecorationCollection.cs
- EventSinkActivityDesigner.cs
- CodePrimitiveExpression.cs
- WebPartsPersonalizationAuthorization.cs
- KerberosReceiverSecurityToken.cs
- VolatileResourceManager.cs
- COM2ExtendedTypeConverter.cs
- SiteMapNodeCollection.cs
- FieldDescriptor.cs
- DurableInstanceManager.cs
- Pens.cs
- ProcessProtocolHandler.cs
- InternalDispatchObject.cs
- MarkupExtensionParser.cs
- DocumentReference.cs
- namescope.cs
- CodeSnippetCompileUnit.cs
- Clipboard.cs
- ElementsClipboardData.cs
- DayRenderEvent.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- WebPermission.cs
- SimpleApplicationHost.cs
- mediaeventargs.cs
- XmlNodeReader.cs
- ToolboxBitmapAttribute.cs
- SystemIPGlobalProperties.cs
- DSASignatureFormatter.cs