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
- MailFileEditor.cs
- Action.cs
- DynamicDiscoSearcher.cs
- WindowsListViewSubItem.cs
- DataGridViewControlCollection.cs
- WindowsStartMenu.cs
- XmlUtil.cs
- OraclePermission.cs
- QueryableDataSourceView.cs
- PageCatalogPart.cs
- SiteMapProvider.cs
- TypeUtils.cs
- SqlTriggerAttribute.cs
- HttpApplicationFactory.cs
- Base64Encoder.cs
- UserControlParser.cs
- SimpleBitVector32.cs
- Optimizer.cs
- DataControlHelper.cs
- Repeater.cs
- Debug.cs
- PropertyValueUIItem.cs
- HandleExceptionArgs.cs
- SamlDoNotCacheCondition.cs
- MenuItemStyleCollectionEditor.cs
- XmlSchemaChoice.cs
- AccessedThroughPropertyAttribute.cs
- SiteMapSection.cs
- SemanticBasicElement.cs
- OdbcError.cs
- ExclusiveTcpListener.cs
- RightsManagementEncryptionTransform.cs
- TimelineClockCollection.cs
- MimeMultiPart.cs
- UdpReplyToBehavior.cs
- SiteMapNodeCollection.cs
- ListControl.cs
- BooleanAnimationBase.cs
- DataSourceXmlElementAttribute.cs
- MsmqAppDomainProtocolHandler.cs
- EventlogProvider.cs
- TextDecoration.cs
- ExpressionBinding.cs
- DiagnosticTraceSource.cs
- XmlSerializerAssemblyAttribute.cs
- ComponentRenameEvent.cs
- XmlNavigatorStack.cs
- ConstructorExpr.cs
- Attribute.cs
- ObjectConverter.cs
- ValidationUtility.cs
- ContentHostHelper.cs
- HandoffBehavior.cs
- AddIn.cs
- OleServicesContext.cs
- SQLMoneyStorage.cs
- WindowsSecurityToken.cs
- DispatcherHookEventArgs.cs
- ListBox.cs
- XmlFormatExtensionPrefixAttribute.cs
- FontUnit.cs
- CodeExpressionRuleDeclaration.cs
- ResolveDuplex11AsyncResult.cs
- ContentTextAutomationPeer.cs
- RowToParametersTransformer.cs
- LinkConverter.cs
- ToolTip.cs
- VisualStyleInformation.cs
- Suspend.cs
- RC2CryptoServiceProvider.cs
- Activator.cs
- PagedDataSource.cs
- MailHeaderInfo.cs
- WindowsFont.cs
- BaseContextMenu.cs
- XmlLoader.cs
- PasswordTextContainer.cs
- TransformConverter.cs
- Roles.cs
- SQLByte.cs
- GifBitmapEncoder.cs
- GeometryConverter.cs
- Help.cs
- BCLDebug.cs
- DirectionalLight.cs
- LocationSectionRecord.cs
- ImageListImageEditor.cs
- MarkupCompilePass2.cs
- GridItemPatternIdentifiers.cs
- VisualStyleElement.cs
- ClientRoleProvider.cs
- InheritedPropertyDescriptor.cs
- WebPartConnectionsEventArgs.cs
- Matrix3DConverter.cs
- SamlSecurityTokenAuthenticator.cs
- EntityDataSourceContextCreatedEventArgs.cs
- querybuilder.cs
- FormViewActionList.cs
- WmlCommandAdapter.cs
- Facet.cs