Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ManagedIStream.cs
- HttpWebRequestElement.cs
- KeyPullup.cs
- BaseUriHelper.cs
- _Win32.cs
- ProcessThread.cs
- PrivilegedConfigurationManager.cs
- TextServicesCompartmentContext.cs
- __ConsoleStream.cs
- ZipIOExtraFieldElement.cs
- InternalConfigRoot.cs
- DefaultMemberAttribute.cs
- ArrayElementGridEntry.cs
- UrlMapping.cs
- Group.cs
- SelectedDatesCollection.cs
- DataSourceNameHandler.cs
- XomlCompiler.cs
- TcpChannelHelper.cs
- Matrix3DValueSerializer.cs
- InstanceValue.cs
- MemberExpressionHelper.cs
- DoubleLink.cs
- BindingWorker.cs
- BindingExpression.cs
- FileDataSourceCache.cs
- AutoGeneratedFieldProperties.cs
- SecurityUtils.cs
- DeviceContexts.cs
- XamlTreeBuilder.cs
- X509ChainPolicy.cs
- BindableAttribute.cs
- NodeFunctions.cs
- PhysicalFontFamily.cs
- X509PeerCertificateAuthenticationElement.cs
- XmlUTF8TextReader.cs
- IPAddress.cs
- IconBitmapDecoder.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- SecurityUtils.cs
- AudioFormatConverter.cs
- CqlWriter.cs
- WebServicesSection.cs
- ParameterCollectionEditor.cs
- DataGridViewColumnTypeEditor.cs
- XmlNullResolver.cs
- RowSpanVector.cs
- VisualCollection.cs
- Binding.cs
- ellipse.cs
- Model3DGroup.cs
- ProcessModuleCollection.cs
- InternalBufferOverflowException.cs
- TimersDescriptionAttribute.cs
- FieldDescriptor.cs
- DataTablePropertyDescriptor.cs
- WebPartDesigner.cs
- ParallelSeparator.xaml.cs
- CircleEase.cs
- HWStack.cs
- PackageRelationshipCollection.cs
- HwndTarget.cs
- IdentityReference.cs
- WindowsProgressbar.cs
- ThemeDictionaryExtension.cs
- TextSpanModifier.cs
- DescendentsWalker.cs
- SqlMethodAttribute.cs
- ClientSettingsStore.cs
- ExecutionContext.cs
- BackStopAuthenticationModule.cs
- cookie.cs
- ObjectItemAssemblyLoader.cs
- CharAnimationUsingKeyFrames.cs
- Point4D.cs
- AttachInfo.cs
- coordinator.cs
- BasicCommandTreeVisitor.cs
- WsdlParser.cs
- GridPattern.cs
- mediapermission.cs
- DoubleAnimation.cs
- ServerValidateEventArgs.cs
- Random.cs
- AutomationAttributeInfo.cs
- Debug.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- DrawListViewColumnHeaderEventArgs.cs
- Listbox.cs
- ByteStack.cs
- SeekableReadStream.cs
- NoPersistHandle.cs
- TableAutomationPeer.cs
- MenuItemStyleCollection.cs
- Size.cs
- AppearanceEditorPart.cs
- _ListenerResponseStream.cs
- StructureChangedEventArgs.cs
- XmlTypeMapping.cs
- TimerEventSubscription.cs