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
- RightsManagementPermission.cs
- TemplateControlBuildProvider.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- Int16Converter.cs
- EditorZone.cs
- Input.cs
- DataObjectSettingDataEventArgs.cs
- DataKey.cs
- CellParaClient.cs
- Comparer.cs
- DataObject.cs
- DesignerActionPanel.cs
- DocumentAutomationPeer.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- AppDomainCompilerProxy.cs
- Slider.cs
- RequestCache.cs
- XmlSerializer.cs
- LogReservationCollection.cs
- DocumentReference.cs
- NumericUpDown.cs
- StringInfo.cs
- TypefaceCollection.cs
- MobileTextWriter.cs
- TextDecorations.cs
- TemplatePartAttribute.cs
- XmlTypeAttribute.cs
- RolePrincipal.cs
- StickyNoteHelper.cs
- DataBoundControlParameterTarget.cs
- Transform3D.cs
- SafeLibraryHandle.cs
- SignedXml.cs
- ToolTipService.cs
- BuildDependencySet.cs
- InteropAutomationProvider.cs
- PropertySegmentSerializationProvider.cs
- DispatcherTimer.cs
- BrowserCapabilitiesFactoryBase.cs
- SecurityPolicyVersion.cs
- Solver.cs
- WorkflowPrinting.cs
- BitmapMetadata.cs
- ComplexPropertyEntry.cs
- BitmapEffectGroup.cs
- Utility.cs
- AttachmentService.cs
- ComboBox.cs
- X509Utils.cs
- Rect3D.cs
- ListBoxChrome.cs
- DesignerOptions.cs
- XmlSchemaAnyAttribute.cs
- HttpCapabilitiesSectionHandler.cs
- IriParsingElement.cs
- DecimalAnimation.cs
- RepeatButtonAutomationPeer.cs
- Deflater.cs
- InstanceDataCollection.cs
- VirtualizingPanel.cs
- NetMsmqBindingCollectionElement.cs
- CharacterHit.cs
- WindowsIPAddress.cs
- DbParameterHelper.cs
- DataPagerFieldItem.cs
- WebBrowserProgressChangedEventHandler.cs
- PackageDigitalSignature.cs
- SoapObjectWriter.cs
- InternalBufferOverflowException.cs
- XmlTextEncoder.cs
- GridViewSortEventArgs.cs
- SqlUtils.cs
- HttpDictionary.cs
- ParentQuery.cs
- NavigationPropertyEmitter.cs
- BamlLocalizationDictionary.cs
- StorageAssociationSetMapping.cs
- NaturalLanguageHyphenator.cs
- GridItemPattern.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TextEditorTables.cs
- Update.cs
- FormsAuthenticationUser.cs
- InkCollectionBehavior.cs
- WebPartEditorOkVerb.cs
- DataGridViewComboBoxColumn.cs
- DoubleKeyFrameCollection.cs
- BaseServiceProvider.cs
- Polygon.cs
- StylusPointCollection.cs
- XmlElementAttribute.cs
- PersonalizationStateInfo.cs
- PathHelper.cs
- wmiutil.cs
- DeclaredTypeValidator.cs
- LocalFileSettingsProvider.cs
- SurrogateSelector.cs
- SmiGettersStream.cs
- SequenceFullException.cs
- InputGestureCollection.cs