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
- OdbcDataReader.cs
- ContextQuery.cs
- TreeViewImageKeyConverter.cs
- SystemIPGlobalStatistics.cs
- PropertyCollection.cs
- BitmapInitialize.cs
- FontDialog.cs
- GridViewPageEventArgs.cs
- WpfGeneratedKnownTypes.cs
- InkCanvasAutomationPeer.cs
- ContractCodeDomInfo.cs
- UInt32.cs
- ConnectionStringSettingsCollection.cs
- XmlTypeAttribute.cs
- TableCellCollection.cs
- XmlDocumentSerializer.cs
- PointAnimationBase.cs
- BitmapEffectDrawingContextState.cs
- TrailingSpaceComparer.cs
- ReflectPropertyDescriptor.cs
- Comparer.cs
- HtmlHistory.cs
- DependencyPropertyAttribute.cs
- RouteData.cs
- COM2EnumConverter.cs
- SamlSubjectStatement.cs
- MouseGestureValueSerializer.cs
- Win32Native.cs
- WebPartZoneDesigner.cs
- WebServiceErrorEvent.cs
- UnhandledExceptionEventArgs.cs
- StringUtil.cs
- IntPtr.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
- RectAnimationClockResource.cs
- PingOptions.cs
- XmlSerializationGeneratedCode.cs
- TargetControlTypeAttribute.cs
- EncoderParameters.cs
- StackOverflowException.cs
- MarkupCompilePass2.cs
- DbProviderFactories.cs
- StylusDownEventArgs.cs
- TraceLog.cs
- RenderOptions.cs
- RtfNavigator.cs
- BinarySecretSecurityToken.cs
- DocumentSequenceHighlightLayer.cs
- TokenFactoryBase.cs
- ConversionHelper.cs
- sqlpipe.cs
- XmlUtf8RawTextWriter.cs
- SoundPlayer.cs
- ListViewInsertEventArgs.cs
- NameSpaceEvent.cs
- DeadCharTextComposition.cs
- Binding.cs
- FilterElement.cs
- LabelLiteral.cs
- PtsPage.cs
- PeerObject.cs
- ViewBox.cs
- Parallel.cs
- DataGridViewRowPostPaintEventArgs.cs
- Helper.cs
- PublisherMembershipCondition.cs
- WorkflowRuntimeBehavior.cs
- GPStream.cs
- LambdaCompiler.Unary.cs
- control.ime.cs
- DataBindingCollectionEditor.cs
- columnmapkeybuilder.cs
- LoginView.cs
- HttpApplication.cs
- InkPresenterAutomationPeer.cs
- COM2ICategorizePropertiesHandler.cs
- ParserStreamGeometryContext.cs
- MbpInfo.cs
- CommonProperties.cs
- FontCacheLogic.cs
- ConnectionOrientedTransportManager.cs
- EdmSchemaAttribute.cs
- SafeIUnknown.cs
- ExceptionTranslationTable.cs
- MulticastNotSupportedException.cs
- RecordConverter.cs
- SchemaImporter.cs
- TypographyProperties.cs
- FormViewDeleteEventArgs.cs
- SecurityTokenRequirement.cs
- FileRecordSequenceHelper.cs
- DataControlFieldHeaderCell.cs
- ResourceBinder.cs
- InvokeProviderWrapper.cs
- CaseInsensitiveComparer.cs
- UICuesEvent.cs
- DbProviderServices.cs
- InputBinding.cs
- UriTemplateMatch.cs
- FrameworkEventSource.cs