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
- ModelUIElement3D.cs
- ServerIdentity.cs
- SqlGatherProducedAliases.cs
- HttpRequestTraceRecord.cs
- ClockGroup.cs
- TableProviderWrapper.cs
- EnumerableRowCollectionExtensions.cs
- XhtmlConformanceSection.cs
- RandomNumberGenerator.cs
- GridPatternIdentifiers.cs
- FieldNameLookup.cs
- WebPartConnectVerb.cs
- DiscoveryMessageProperty.cs
- DataSourceControl.cs
- SymLanguageType.cs
- PeerEndPoint.cs
- Trace.cs
- LoginStatusDesigner.cs
- ExceptionHandler.cs
- WebBrowser.cs
- RuntimeWrappedException.cs
- DescendantQuery.cs
- Internal.cs
- XmlElement.cs
- DelegatingTypeDescriptionProvider.cs
- SelectionPattern.cs
- PackageFilter.cs
- ConfigsHelper.cs
- LowerCaseStringConverter.cs
- SafeCryptoHandles.cs
- SynchronizedDispatch.cs
- SmtpClient.cs
- Bezier.cs
- FrameworkContentElement.cs
- ServerValidateEventArgs.cs
- Int32Converter.cs
- ManagementInstaller.cs
- Debug.cs
- DotExpr.cs
- WebPageTraceListener.cs
- PasswordRecoveryAutoFormat.cs
- WriteFileContext.cs
- Nodes.cs
- StylusButtonEventArgs.cs
- COM2ExtendedBrowsingHandler.cs
- ThreadAbortException.cs
- TableParaClient.cs
- XmlCharType.cs
- GroupBoxDesigner.cs
- SingleTagSectionHandler.cs
- DesignerCategoryAttribute.cs
- MexHttpBindingCollectionElement.cs
- DataGridViewCellStateChangedEventArgs.cs
- MatrixTransform.cs
- ConfigurationElementCollection.cs
- AppSettingsReader.cs
- PropertyMapper.cs
- ColumnBinding.cs
- SessionSwitchEventArgs.cs
- ResourceContainer.cs
- XmlSchemaSequence.cs
- GroupBox.cs
- HostAdapter.cs
- PanelStyle.cs
- AssemblyNameProxy.cs
- Matrix3D.cs
- BitmapEffectGroup.cs
- BitmapFrame.cs
- FormViewInsertEventArgs.cs
- TemplateLookupAction.cs
- ApplicationFileParser.cs
- UnaryNode.cs
- AttachedAnnotation.cs
- SafeMILHandle.cs
- TcpConnectionPoolSettingsElement.cs
- CodeSubDirectoriesCollection.cs
- TokenizerHelper.cs
- UnsafeNativeMethods.cs
- PagedDataSource.cs
- CompilerWrapper.cs
- MsmqQueue.cs
- ResourcesBuildProvider.cs
- PersonalizableAttribute.cs
- ControlParameter.cs
- DataBinding.cs
- LogFlushAsyncResult.cs
- ComEventsInfo.cs
- CallInfo.cs
- IconBitmapDecoder.cs
- RectValueSerializer.cs
- Random.cs
- Triangle.cs
- CodeCompileUnit.cs
- SmtpFailedRecipientsException.cs
- CompilerState.cs
- UnsafeNativeMethodsCLR.cs
- DefaultTraceListener.cs
- InkCanvasInnerCanvas.cs
- EventLogPermissionAttribute.cs
- UnmanagedMemoryAccessor.cs