Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / DelayedRegex.cs / 1305376 / 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
- DbProviderFactories.cs
- MissingMethodException.cs
- XMLUtil.cs
- DataGridCell.cs
- ParenthesizePropertyNameAttribute.cs
- XmlTextReader.cs
- ComponentDispatcherThread.cs
- TracedNativeMethods.cs
- ExtenderControl.cs
- DataSysAttribute.cs
- OleDbConnectionFactory.cs
- NameValuePair.cs
- WindowsTokenRoleProvider.cs
- RijndaelCryptoServiceProvider.cs
- HGlobalSafeHandle.cs
- NameValueSectionHandler.cs
- SystemParameters.cs
- EntityKey.cs
- SoapInteropTypes.cs
- XpsS0ValidatingLoader.cs
- ItemCollection.cs
- DoubleAnimationBase.cs
- RightNameExpirationInfoPair.cs
- DataGridViewCellValueEventArgs.cs
- ContextStaticAttribute.cs
- ClientType.cs
- SiteMembershipCondition.cs
- hebrewshape.cs
- ToolStripCustomTypeDescriptor.cs
- EndOfStreamException.cs
- FixedSOMPageConstructor.cs
- ExceptionHelpers.cs
- MULTI_QI.cs
- LabelDesigner.cs
- ChangeConflicts.cs
- LiteralControl.cs
- FramingEncoders.cs
- CompilerGlobalScopeAttribute.cs
- Image.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- SystemIPAddressInformation.cs
- OleDbInfoMessageEvent.cs
- DesignRelationCollection.cs
- PageCodeDomTreeGenerator.cs
- HtmlElement.cs
- LedgerEntryCollection.cs
- TypeForwardedFromAttribute.cs
- KnownBoxes.cs
- ResourceManager.cs
- TypeNameParser.cs
- GC.cs
- SecurityPolicySection.cs
- StrongNamePublicKeyBlob.cs
- baseaxisquery.cs
- ToolStripStatusLabel.cs
- BitmapImage.cs
- UIElementAutomationPeer.cs
- BooleanStorage.cs
- SmuggledIUnknown.cs
- tabpagecollectioneditor.cs
- MenuItem.cs
- ContainerTracking.cs
- ControlEvent.cs
- ZeroOpNode.cs
- ProjectionAnalyzer.cs
- TableLayoutStyle.cs
- SharedPerformanceCounter.cs
- CodeExpressionCollection.cs
- PageTheme.cs
- OutputScopeManager.cs
- BaseDataListActionList.cs
- DependsOnAttribute.cs
- DataServiceClientException.cs
- RuleRefElement.cs
- DeadCharTextComposition.cs
- DataGridState.cs
- XmlHierarchicalEnumerable.cs
- DataFieldCollectionEditor.cs
- UserPersonalizationStateInfo.cs
- AutomationPatternInfo.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- ResXResourceReader.cs
- PackWebRequestFactory.cs
- InheritedPropertyChangedEventArgs.cs
- TextViewBase.cs
- SiteMapSection.cs
- TimeSpanValidatorAttribute.cs
- OrderedHashRepartitionEnumerator.cs
- HttpCookie.cs
- SafeHandles.cs
- PrintEvent.cs
- MonthChangedEventArgs.cs
- TypeValidationEventArgs.cs
- ListenerAdaptersInstallComponent.cs
- SwitchAttribute.cs
- ZoomPercentageConverter.cs
- ProjectionCamera.cs
- UnicodeEncoding.cs
- Evaluator.cs
- AppearanceEditorPart.cs