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
- DateTimeParse.cs
- XmlParserContext.cs
- PasswordDeriveBytes.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- UITypeEditors.cs
- UrlAuthorizationModule.cs
- TreeViewItemAutomationPeer.cs
- NotifyIcon.cs
- HybridDictionary.cs
- DataBindingExpressionBuilder.cs
- SafeNativeMethodsOther.cs
- EnumConverter.cs
- XmlWhitespace.cs
- DesignerSerializerAttribute.cs
- CheckBoxRenderer.cs
- ErrorFormatterPage.cs
- DeflateStream.cs
- MetadataPropertyCollection.cs
- PenThread.cs
- EntityDataSourceContextCreatingEventArgs.cs
- TemplateLookupAction.cs
- HostingEnvironmentSection.cs
- AttachmentService.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- MaterialCollection.cs
- XmlSchemaChoice.cs
- GridItemPattern.cs
- ImageMetadata.cs
- ActivationWorker.cs
- ConfigXmlText.cs
- PointLightBase.cs
- DateTimeUtil.cs
- ThemeableAttribute.cs
- HttpPostProtocolReflector.cs
- ManagementEventWatcher.cs
- CustomBindingCollectionElement.cs
- SmiXetterAccessMap.cs
- Util.cs
- RotateTransform.cs
- localization.cs
- Padding.cs
- DetailsViewDeleteEventArgs.cs
- StatusBarPanelClickEvent.cs
- PathGeometry.cs
- UpWmlMobileTextWriter.cs
- FilteredSchemaElementLookUpTable.cs
- WebBrowserBase.cs
- ConfigXmlAttribute.cs
- HttpProcessUtility.cs
- ZipIOExtraFieldZip64Element.cs
- InstanceCreationEditor.cs
- PageThemeParser.cs
- PropertyReference.cs
- DataBoundLiteralControl.cs
- FlatButtonAppearance.cs
- TaskFileService.cs
- PLINQETWProvider.cs
- MappingItemCollection.cs
- ServiceDefaults.cs
- _NegoStream.cs
- Identity.cs
- DependencyPropertyKind.cs
- GcHandle.cs
- XmlIlGenerator.cs
- ContentPathSegment.cs
- ListControl.cs
- SmtpNtlmAuthenticationModule.cs
- CodeSubDirectory.cs
- XXXInfos.cs
- Attributes.cs
- TargetConverter.cs
- GenerateTemporaryAssemblyTask.cs
- Comparer.cs
- KnownBoxes.cs
- InternalResources.cs
- ScrollBar.cs
- XsltCompileContext.cs
- Int16AnimationBase.cs
- CompositeFontFamily.cs
- BaseAppDomainProtocolHandler.cs
- ExitEventArgs.cs
- XmlSchemaAny.cs
- XmlCharacterData.cs
- BevelBitmapEffect.cs
- DllHostedComPlusServiceHost.cs
- XslAst.cs
- LocatorGroup.cs
- SqlErrorCollection.cs
- BuildManager.cs
- TransformedBitmap.cs
- Nullable.cs
- TransformDescriptor.cs
- PropertyHelper.cs
- HttpListenerElement.cs
- ListViewItem.cs
- ParseHttpDate.cs
- util.cs
- HtmlEmptyTagControlBuilder.cs
- BuildProviderAppliesToAttribute.cs
- StylusOverProperty.cs