Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / Configuration / DelayedRegex.cs / 1 / DelayedRegex.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System.Collections; using System.Configuration; using System.IO; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Web.Configuration; using System.Web.Util; using System.Xml; using Pair = System.Web.UI.Pair; internal class DelayedRegex { private String _regstring; private Regex _regex; internal DelayedRegex(String s) { _regex = null; _regstring = s; } internal Match Match(String s) { EnsureRegex(); return _regex.Match(s); } internal int GroupNumberFromName(String name) { EnsureRegex(); return _regex.GroupNumberFromName(name); } internal void EnsureRegex() { string regstring = _regstring; if(_regex == null) { _regex = new Regex(regstring); //free original _regstring = null; } return; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System.Collections; using System.Configuration; using System.IO; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Web.Configuration; using System.Web.Util; using System.Xml; using Pair = System.Web.UI.Pair; internal class DelayedRegex { private String _regstring; private Regex _regex; internal DelayedRegex(String s) { _regex = null; _regstring = s; } internal Match Match(String s) { EnsureRegex(); return _regex.Match(s); } internal int GroupNumberFromName(String name) { EnsureRegex(); return _regex.GroupNumberFromName(name); } internal void EnsureRegex() { string regstring = _regstring; if(_regex == null) { _regex = new Regex(regstring); //free original _regstring = null; } return; } } } // 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
- FormatConvertedBitmap.cs
- PropertyItem.cs
- ProxyHwnd.cs
- CheckBoxRenderer.cs
- ACL.cs
- EntityCommandDefinition.cs
- XmlSerializerAssemblyAttribute.cs
- JpegBitmapDecoder.cs
- _ConnectStream.cs
- GPPOINT.cs
- TypeGeneratedEventArgs.cs
- ContextInformation.cs
- DiagnosticTraceSource.cs
- _DigestClient.cs
- KeyManager.cs
- InputLanguage.cs
- ToolStripItemRenderEventArgs.cs
- TcpTransportSecurity.cs
- InstanceKeyNotReadyException.cs
- ReflectPropertyDescriptor.cs
- TextElementEditingBehaviorAttribute.cs
- SamlAttributeStatement.cs
- CodeStatement.cs
- ColorConvertedBitmap.cs
- IndexedString.cs
- MDIWindowDialog.cs
- externdll.cs
- ProcessModelSection.cs
- NumericPagerField.cs
- DbDataAdapter.cs
- RichTextBox.cs
- TypeDescriptionProviderAttribute.cs
- CompilerInfo.cs
- FollowerQueueCreator.cs
- BuildResult.cs
- CompilationUtil.cs
- VersionedStreamOwner.cs
- Rect.cs
- TTSVoice.cs
- ClientSettingsSection.cs
- WebPartUserCapability.cs
- XmlBinaryReader.cs
- InputLanguageEventArgs.cs
- CollectionConverter.cs
- FrugalMap.cs
- SurrogateDataContract.cs
- NamespaceEmitter.cs
- BaseHashHelper.cs
- ExpressionBindingsDialog.cs
- HtmlInputReset.cs
- HttpCachePolicyElement.cs
- Pts.cs
- assertwrapper.cs
- SchemaType.cs
- RetrieveVirtualItemEventArgs.cs
- CreateUserErrorEventArgs.cs
- EditorZone.cs
- ComboBoxRenderer.cs
- XPathNodeHelper.cs
- ToolStripItemBehavior.cs
- SystemNetHelpers.cs
- ObjectConverter.cs
- TableLayout.cs
- SafeEventLogWriteHandle.cs
- UserControlBuildProvider.cs
- Vector3D.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- Transform.cs
- WmlLiteralTextAdapter.cs
- ImageFormatConverter.cs
- _KerberosClient.cs
- PropertyBuilder.cs
- MetadataItem.cs
- CachedPathData.cs
- SmiEventStream.cs
- VariantWrapper.cs
- XXXInfos.cs
- WebPartTransformerAttribute.cs
- WindowsFont.cs
- SqlLiftWhereClauses.cs
- WindowClosedEventArgs.cs
- SerializerProvider.cs
- WebEvents.cs
- CodeIndexerExpression.cs
- TextEditorParagraphs.cs
- DefaultPropertyAttribute.cs
- ISAPIRuntime.cs
- XsltException.cs
- EventDescriptor.cs
- SiteMap.cs
- ProcessHostServerConfig.cs
- SoapIgnoreAttribute.cs
- TableLayoutSettings.cs
- DataSourceControl.cs
- Matrix3D.cs
- StandardToolWindows.cs
- IncrementalCompileAnalyzer.cs
- CustomAttributeSerializer.cs
- FileDetails.cs
- InternalConfigHost.cs