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
- SettingsPropertyWrongTypeException.cs
- ButtonBase.cs
- SafeRightsManagementHandle.cs
- ListDesigner.cs
- ListItemCollection.cs
- FileLoadException.cs
- GetPageNumberCompletedEventArgs.cs
- SystemFonts.cs
- HtmlElementEventArgs.cs
- WebPartAuthorizationEventArgs.cs
- LineUtil.cs
- TypeConverter.cs
- ConstrainedGroup.cs
- HebrewNumber.cs
- XmlElementList.cs
- SplitterPanel.cs
- SchemaMerger.cs
- QuadraticBezierSegment.cs
- HtmlInputButton.cs
- CreateRefExpr.cs
- Page.cs
- SmtpDigestAuthenticationModule.cs
- SafeThreadHandle.cs
- DateTimeOffsetStorage.cs
- PreviewKeyDownEventArgs.cs
- EdmToObjectNamespaceMap.cs
- OutOfMemoryException.cs
- SelectionRange.cs
- EventLogStatus.cs
- DataFormat.cs
- DesignBinding.cs
- AmbiguousMatchException.cs
- MatrixUtil.cs
- WorkerRequest.cs
- HttpFileCollectionWrapper.cs
- XmlObjectSerializerReadContext.cs
- ReversePositionQuery.cs
- RowUpdatedEventArgs.cs
- MembershipSection.cs
- DataRelation.cs
- ReliableMessagingHelpers.cs
- DoubleAnimationUsingKeyFrames.cs
- BaseTemplateParser.cs
- Misc.cs
- BindingElementCollection.cs
- UserPersonalizationStateInfo.cs
- XmlSortKey.cs
- IISUnsafeMethods.cs
- DependencyObjectType.cs
- HtmlCalendarAdapter.cs
- CollectionChangeEventArgs.cs
- SqlAggregateChecker.cs
- PersonalizationStateInfoCollection.cs
- ProgressBarHighlightConverter.cs
- ScrollData.cs
- CardSpacePolicyElement.cs
- SplitterCancelEvent.cs
- LambdaCompiler.Logical.cs
- XPathSelfQuery.cs
- ReadOnlyKeyedCollection.cs
- Pkcs7Signer.cs
- TableStyle.cs
- CreateUserWizard.cs
- WebBrowserUriTypeConverter.cs
- TypeKeyValue.cs
- TemplateFactory.cs
- FieldMetadata.cs
- ResourceContainer.cs
- TokenBasedSet.cs
- SqlParameterCollection.cs
- ChannelManager.cs
- Expr.cs
- ColumnReorderedEventArgs.cs
- HelpFileFileNameEditor.cs
- TraceEventCache.cs
- SystemTcpStatistics.cs
- RestHandlerFactory.cs
- DbgUtil.cs
- ThrowHelper.cs
- ToolStripLabel.cs
- OutputScopeManager.cs
- Bitmap.cs
- ProgressChangedEventArgs.cs
- SystemIcmpV6Statistics.cs
- FrameDimension.cs
- Rotation3DAnimation.cs
- ControlBindingsConverter.cs
- ProfileService.cs
- UIElementPropertyUndoUnit.cs
- EFColumnProvider.cs
- MatrixUtil.cs
- Serializer.cs
- SyndicationDeserializer.cs
- CodeNamespaceImport.cs
- DynamicMetaObject.cs
- SQLCharsStorage.cs
- ExpandedProjectionNode.cs
- Keywords.cs
- TrustManagerMoreInformation.cs
- ConnectionsZone.cs