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
- Unit.cs
- HelpInfo.cs
- FontCollection.cs
- SqlFunctionAttribute.cs
- DynamicActivityProperty.cs
- TimeoutException.cs
- FigureHelper.cs
- SecUtil.cs
- Fx.cs
- OneToOneMappingSerializer.cs
- SurrogateDataContract.cs
- DataFormat.cs
- BinaryConverter.cs
- Misc.cs
- XmlSchemaSimpleTypeRestriction.cs
- ProxySimple.cs
- PassportPrincipal.cs
- AxisAngleRotation3D.cs
- AggregationMinMaxHelpers.cs
- ResourceKey.cs
- NameValueCache.cs
- Helper.cs
- ItemCheckedEvent.cs
- ClickablePoint.cs
- FontUnitConverter.cs
- Array.cs
- RegionData.cs
- GeneralTransform3D.cs
- selecteditemcollection.cs
- XmlWhitespace.cs
- Menu.cs
- FixedSOMImage.cs
- HtmlTableRow.cs
- WindowsGraphicsCacheManager.cs
- CodeAttributeArgument.cs
- SubqueryRules.cs
- GridViewColumnCollection.cs
- SuppressIldasmAttribute.cs
- SymbolType.cs
- DataKey.cs
- TextSelectionProcessor.cs
- VirtualizedCellInfoCollection.cs
- LineUtil.cs
- DesignBinding.cs
- HostedAspNetEnvironment.cs
- GetCryptoTransformRequest.cs
- TaskCanceledException.cs
- HMACMD5.cs
- XmlArrayItemAttributes.cs
- PointLight.cs
- DataGridViewColumnCollection.cs
- EventDescriptor.cs
- InplaceBitmapMetadataWriter.cs
- BookmarkResumptionRecord.cs
- GridViewItemAutomationPeer.cs
- Lookup.cs
- SystemInfo.cs
- EntityStoreSchemaGenerator.cs
- DocumentCollection.cs
- ZipIOBlockManager.cs
- TemplateColumn.cs
- Invariant.cs
- StagingAreaInputItem.cs
- LineGeometry.cs
- BuildProviderAppliesToAttribute.cs
- QilXmlWriter.cs
- CompiledRegexRunner.cs
- XmlSchemaFacet.cs
- Buffer.cs
- XmlILIndex.cs
- COSERVERINFO.cs
- VersionPair.cs
- TreeViewImageKeyConverter.cs
- TemplateBamlTreeBuilder.cs
- DesignerSerializerAttribute.cs
- ConnectionOrientedTransportBindingElement.cs
- PasswordDeriveBytes.cs
- BamlRecordHelper.cs
- InputBinder.cs
- NativeMethods.cs
- MultiDataTrigger.cs
- InkCanvas.cs
- SafeNativeMethods.cs
- QueueProcessor.cs
- FileReservationCollection.cs
- WebPartCollection.cs
- Preprocessor.cs
- GcSettings.cs
- Int32Storage.cs
- ISAPIApplicationHost.cs
- PathFigureCollectionConverter.cs
- BinHexEncoder.cs
- StateRuntime.cs
- NegotiateStream.cs
- XmlHierarchicalDataSourceView.cs
- MarkupExtensionParser.cs
- RadioButtonPopupAdapter.cs
- XmlException.cs
- InstanceData.cs
- ToolStripRenderer.cs