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
- InternalDuplexChannelFactory.cs
- DrawingDrawingContext.cs
- DataBinder.cs
- Helpers.cs
- CapabilitiesAssignment.cs
- RegistrySecurity.cs
- PathFigureCollection.cs
- AuthStoreRoleProvider.cs
- BuildProvidersCompiler.cs
- indexingfiltermarshaler.cs
- SettingsPropertyValue.cs
- ToolStripDropDownClosingEventArgs.cs
- XmlSchemaAll.cs
- ContainerActivationHelper.cs
- ListViewCancelEventArgs.cs
- PageCodeDomTreeGenerator.cs
- LinqDataSourceStatusEventArgs.cs
- DetailsViewDeleteEventArgs.cs
- SystemIPInterfaceProperties.cs
- ImportContext.cs
- SpeechSeg.cs
- AppSecurityManager.cs
- Image.cs
- OdbcEnvironmentHandle.cs
- GuidelineCollection.cs
- Documentation.cs
- SerializerDescriptor.cs
- ProfileGroupSettings.cs
- BindableTemplateBuilder.cs
- TypeBuilder.cs
- ECDsaCng.cs
- PartialArray.cs
- formatstringdialog.cs
- ConnectivityStatus.cs
- ContentFilePart.cs
- SuppressMergeCheckAttribute.cs
- ValueUtilsSmi.cs
- Random.cs
- ZoomComboBox.cs
- HotCommands.cs
- Section.cs
- XmlSignatureProperties.cs
- TreeNodeBindingCollection.cs
- MaskedTextBoxDesignerActionList.cs
- ConfigXmlText.cs
- EntityDataSourceSelectingEventArgs.cs
- UInt64Storage.cs
- xmlsaver.cs
- PropertyPushdownHelper.cs
- ToolBarButtonClickEvent.cs
- FormatVersion.cs
- Point4DConverter.cs
- invalidudtexception.cs
- PrintControllerWithStatusDialog.cs
- PageCache.cs
- SizeAnimation.cs
- RuntimeConfig.cs
- Connector.xaml.cs
- PropertyEmitter.cs
- AsyncPostBackTrigger.cs
- ConsoleKeyInfo.cs
- IisTraceWebEventProvider.cs
- DataRowView.cs
- UnauthorizedAccessException.cs
- DataServiceProcessingPipeline.cs
- XmlNamespaceDeclarationsAttribute.cs
- HostingEnvironmentSection.cs
- DuplicateWaitObjectException.cs
- DesignTimeParseData.cs
- StackOverflowException.cs
- ArraySegment.cs
- TimelineGroup.cs
- TextPointer.cs
- StagingAreaInputItem.cs
- URLIdentityPermission.cs
- ResetableIterator.cs
- PageBreakRecord.cs
- XmlReaderSettings.cs
- DeclarativeCatalogPart.cs
- Point.cs
- FlowDocument.cs
- _ConnectOverlappedAsyncResult.cs
- SmiEventSink_Default.cs
- CustomErrorsSectionWrapper.cs
- LazyTextWriterCreator.cs
- ByteAnimationBase.cs
- SecurityDescriptor.cs
- BitmapMetadata.cs
- versioninfo.cs
- TextServicesDisplayAttribute.cs
- XmlUtil.cs
- WindowsButton.cs
- ToolBarButtonClickEvent.cs
- Point3DCollectionConverter.cs
- ParallelDesigner.cs
- CompilerLocalReference.cs
- SecurityDocument.cs
- DeclarativeCatalogPart.cs
- SymDocumentType.cs
- EntityModelBuildProvider.cs