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
- ToolStripDesignerAvailabilityAttribute.cs
- SwitchExpression.cs
- BaseCAMarshaler.cs
- ParameterBuilder.cs
- SourceElementsCollection.cs
- OracleDateTime.cs
- HostedTransportConfigurationBase.cs
- Trace.cs
- NetPeerTcpBindingElement.cs
- _ConnectionGroup.cs
- TreeSet.cs
- SqlStream.cs
- DataGridColumnCollection.cs
- SqlUDTStorage.cs
- CompilerErrorCollection.cs
- TcpAppDomainProtocolHandler.cs
- GridViewSortEventArgs.cs
- RawAppCommandInputReport.cs
- HttpFileCollectionWrapper.cs
- ByteStreamMessage.cs
- HebrewCalendar.cs
- ScriptReferenceBase.cs
- NamedPermissionSet.cs
- LookupNode.cs
- ListView.cs
- ConnectionStringsSection.cs
- PolyLineSegment.cs
- SQLInt16.cs
- PaginationProgressEventArgs.cs
- DataGridHeaderBorder.cs
- SequenceQuery.cs
- DataGridItemEventArgs.cs
- FixedFindEngine.cs
- xmlsaver.cs
- ProgressBar.cs
- ServiceBehaviorAttribute.cs
- bidPrivateBase.cs
- ControlValuePropertyAttribute.cs
- httpstaticobjectscollection.cs
- ItemMap.cs
- OdbcConnection.cs
- ResXBuildProvider.cs
- MatrixUtil.cs
- PropertyEmitterBase.cs
- GeneralTransform3DTo2D.cs
- parserscommon.cs
- TiffBitmapDecoder.cs
- SqlDataSourceView.cs
- CallbackTimeoutsElement.cs
- CollectionBase.cs
- ThemeableAttribute.cs
- RpcResponse.cs
- BuildProviderAppliesToAttribute.cs
- AbstractDataSvcMapFileLoader.cs
- PinnedBufferMemoryStream.cs
- XmlQueryStaticData.cs
- TemplateInstanceAttribute.cs
- XmlSchemaComplexContentRestriction.cs
- ThreadAttributes.cs
- WebPartTransformerAttribute.cs
- DocumentsTrace.cs
- TableLayoutRowStyleCollection.cs
- DetailsViewPageEventArgs.cs
- ExpressionWriter.cs
- ByeOperationAsyncResult.cs
- DataBindingCollection.cs
- ImageIndexConverter.cs
- DBBindings.cs
- WhitespaceRuleReader.cs
- TransformerInfo.cs
- EntityParameter.cs
- IdentityValidationException.cs
- TemplateKey.cs
- EncryptedKey.cs
- CategoryNameCollection.cs
- SqlBulkCopy.cs
- ValueTypeFixupInfo.cs
- MediaPlayer.cs
- XpsResource.cs
- HashCodeCombiner.cs
- PrintPreviewDialog.cs
- AssociationProvider.cs
- RemotingException.cs
- IPEndPoint.cs
- HMACSHA256.cs
- TypedElement.cs
- ObjectReferenceStack.cs
- MouseGesture.cs
- TriState.cs
- BaseParser.cs
- localization.cs
- SafeProcessHandle.cs
- AdapterUtil.cs
- SQLRoleProvider.cs
- _DisconnectOverlappedAsyncResult.cs
- RequestStatusBarUpdateEventArgs.cs
- WebPartExportVerb.cs
- SQLMembershipProvider.cs
- InkCanvas.cs
- ArgumentsParser.cs