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
- PenLineCapValidation.cs
- BaseProcessor.cs
- StyleSheet.cs
- WriteTimeStream.cs
- RenderCapability.cs
- OracleTimeSpan.cs
- ReliableSessionElement.cs
- CompoundFileStreamReference.cs
- ProfessionalColorTable.cs
- SubMenuStyle.cs
- DynamicUpdateCommand.cs
- InputBinder.cs
- InlineObject.cs
- MetadataArtifactLoaderComposite.cs
- UnknownWrapper.cs
- MDIWindowDialog.cs
- MailMessageEventArgs.cs
- ResourcesChangeInfo.cs
- ClientBuildManager.cs
- AsymmetricKeyExchangeDeformatter.cs
- AsyncPostBackErrorEventArgs.cs
- XmlReader.cs
- Proxy.cs
- ExitEventArgs.cs
- DynamicArgumentDesigner.xaml.cs
- ChtmlFormAdapter.cs
- TabControlToolboxItem.cs
- SettingsContext.cs
- IncrementalCompileAnalyzer.cs
- MaterialCollection.cs
- WebPartDisplayMode.cs
- TableLayoutCellPaintEventArgs.cs
- CompareValidator.cs
- ImageDrawing.cs
- Triangle.cs
- ErrorLog.cs
- LinkButton.cs
- OdbcParameterCollection.cs
- StorageSetMapping.cs
- MenuEventArgs.cs
- LogAppendAsyncResult.cs
- UnaryNode.cs
- StringConverter.cs
- Win32Native.cs
- HtmlLinkAdapter.cs
- ArraySortHelper.cs
- PolicyException.cs
- ToolConsole.cs
- XmlSchemaInclude.cs
- LocatorBase.cs
- CodeIterationStatement.cs
- OdbcParameter.cs
- HTMLTextWriter.cs
- ZoneMembershipCondition.cs
- SearchExpression.cs
- DefinitionUpdate.cs
- UTF8Encoding.cs
- AutomationProperty.cs
- TextTreeTextBlock.cs
- TextTreeInsertElementUndoUnit.cs
- BufferedReadStream.cs
- _NetRes.cs
- RoleGroup.cs
- TreeNode.cs
- ToolZone.cs
- XamlReaderHelper.cs
- DataRecordInternal.cs
- ApplicationInterop.cs
- EventWaitHandle.cs
- DecimalConstantAttribute.cs
- IProducerConsumerCollection.cs
- BitmapImage.cs
- WrapPanel.cs
- SqlWebEventProvider.cs
- ServiceModelEnumValidatorAttribute.cs
- GregorianCalendar.cs
- HttpPostedFileBase.cs
- DataGridViewColumnConverter.cs
- WebBaseEventKeyComparer.cs
- ZipIOLocalFileBlock.cs
- TreeNodeClickEventArgs.cs
- TextTreeObjectNode.cs
- ConnectionProviderAttribute.cs
- Thumb.cs
- DeviceOverridableAttribute.cs
- FixedPageProcessor.cs
- TemplateField.cs
- FrameworkContextData.cs
- PerformanceCounters.cs
- ColorConvertedBitmap.cs
- MethodToken.cs
- Selector.cs
- OLEDB_Enum.cs
- LongValidator.cs
- LicenseProviderAttribute.cs
- QueryRewriter.cs
- OracleCommandBuilder.cs
- FunctionGenerator.cs
- SQLInt16.cs
- IndexedGlyphRun.cs