Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ButtonBase.cs
- MessageQueueCriteria.cs
- WindowsAuthenticationEventArgs.cs
- ResourceAssociationSet.cs
- TypeGeneratedEventArgs.cs
- MembershipSection.cs
- WindowsAuthenticationEventArgs.cs
- Crc32.cs
- MaterialGroup.cs
- FreeFormPanel.cs
- XmlSerializerVersionAttribute.cs
- SecureEnvironment.cs
- ReflectionPermission.cs
- ControlBuilderAttribute.cs
- MobileListItem.cs
- SemaphoreSecurity.cs
- FontFamilyIdentifier.cs
- IndentedTextWriter.cs
- TakeQueryOptionExpression.cs
- DiscoveryDocumentReference.cs
- DbSetClause.cs
- Visitors.cs
- ControlBuilder.cs
- Aggregates.cs
- TextOnlyOutput.cs
- CultureNotFoundException.cs
- Matrix.cs
- NotCondition.cs
- PageParser.cs
- InvokeMethodDesigner.xaml.cs
- ArcSegment.cs
- GridViewPageEventArgs.cs
- DesignerResources.cs
- TraceSource.cs
- FontResourceCache.cs
- ReadWriteSpinLock.cs
- Convert.cs
- __Filters.cs
- Automation.cs
- TreeNodeBindingCollection.cs
- ParenthesizePropertyNameAttribute.cs
- CapabilitiesRule.cs
- DelegatingTypeDescriptionProvider.cs
- SqlExpander.cs
- UIElement.cs
- XmlSchemaComplexType.cs
- CaseInsensitiveHashCodeProvider.cs
- Trace.cs
- XmlNodeChangedEventArgs.cs
- PropertyInfo.cs
- WebColorConverter.cs
- SetIndexBinder.cs
- WebServiceErrorEvent.cs
- TrackingParticipant.cs
- BoundPropertyEntry.cs
- UrlRoutingModule.cs
- ImageInfo.cs
- FrameworkEventSource.cs
- HttpServerProtocol.cs
- PrefixHandle.cs
- EditingCoordinator.cs
- GreenMethods.cs
- Slider.cs
- GacUtil.cs
- LogPolicy.cs
- AffineTransform3D.cs
- _ChunkParse.cs
- OutOfProcStateClientManager.cs
- Path.cs
- IndexingContentUnit.cs
- PerformanceCounters.cs
- SamlAuthorizationDecisionStatement.cs
- ParseHttpDate.cs
- ParallelTimeline.cs
- GestureRecognizer.cs
- XmlAttribute.cs
- AgileSafeNativeMemoryHandle.cs
- DATA_BLOB.cs
- TrustLevelCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- HMAC.cs
- base64Transforms.cs
- LineServicesRun.cs
- FixedFlowMap.cs
- StorageRoot.cs
- LoadMessageLogger.cs
- SurrogateEncoder.cs
- WebPartConnectionsCancelVerb.cs
- HandleCollector.cs
- StackBuilderSink.cs
- TextElement.cs
- Blend.cs
- ObjectSet.cs
- ReadWriteControlDesigner.cs
- ConstraintConverter.cs
- linebase.cs
- SByteStorage.cs
- ListDesigner.cs
- PermissionAttributes.cs
- UriTemplateCompoundPathSegment.cs