Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Regex / System / Text / RegularExpressions / RegexGroup.cs / 1 / RegexGroup.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
// Group represents the substring or substrings that
// are captured by a single capturing group after one
// regular expression match.
namespace System.Text.RegularExpressions {
using System.Security.Permissions;
///
/// Group
/// represents the results from a single capturing group. A capturing group can
/// capture zero, one, or more strings in a single match because of quantifiers, so
/// Group supplies a collection of Capture objects.
///
[ Serializable() ]
public class Group : Capture {
// the empty group object
internal static Group _emptygroup = new Group(String.Empty, new int[0], 0);
internal int[] _caps;
internal int _capcount;
internal CaptureCollection _capcoll;
internal Group(String text, int[] caps, int capcount)
: base(text, capcount == 0 ? 0 : caps[(capcount - 1) * 2],
capcount == 0 ? 0 : caps[(capcount * 2) - 1]) {
_caps = caps;
_capcount = capcount;
}
/*
* True if the match was successful
*/
///
/// Indicates whether the match is successful.
///
public bool Success {
get {
return _capcount != 0;
}
}
/*
* The collection of all captures for this group
*/
///
///
/// Returns a collection of all the captures matched by the capturing
/// group, in innermost-leftmost-first order (or innermost-rightmost-first order if
/// compiled with the "r" option). The collection may have zero or more items.
///
///
public CaptureCollection Captures {
get {
if (_capcoll == null)
_capcoll = new CaptureCollection(this);
return _capcoll;
}
}
/*
* Convert to a thread-safe object by precomputing cache contents
*/
///
/// Returns
/// a Group object equivalent to the one supplied that is safe to share between
/// multiple threads.
///
[HostProtection(Synchronization=true)]
static public Group Synchronized(Group inner) {
if (inner == null)
throw new ArgumentNullException("inner");
// force Captures to be computed.
CaptureCollection capcoll;
Capture dummy;
capcoll = inner.Captures;
if (inner._capcount > 0)
dummy = capcoll[0];
return inner;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
// Group represents the substring or substrings that
// are captured by a single capturing group after one
// regular expression match.
namespace System.Text.RegularExpressions {
using System.Security.Permissions;
///
/// Group
/// represents the results from a single capturing group. A capturing group can
/// capture zero, one, or more strings in a single match because of quantifiers, so
/// Group supplies a collection of Capture objects.
///
[ Serializable() ]
public class Group : Capture {
// the empty group object
internal static Group _emptygroup = new Group(String.Empty, new int[0], 0);
internal int[] _caps;
internal int _capcount;
internal CaptureCollection _capcoll;
internal Group(String text, int[] caps, int capcount)
: base(text, capcount == 0 ? 0 : caps[(capcount - 1) * 2],
capcount == 0 ? 0 : caps[(capcount * 2) - 1]) {
_caps = caps;
_capcount = capcount;
}
/*
* True if the match was successful
*/
///
/// Indicates whether the match is successful.
///
public bool Success {
get {
return _capcount != 0;
}
}
/*
* The collection of all captures for this group
*/
///
///
/// Returns a collection of all the captures matched by the capturing
/// group, in innermost-leftmost-first order (or innermost-rightmost-first order if
/// compiled with the "r" option). The collection may have zero or more items.
///
///
public CaptureCollection Captures {
get {
if (_capcoll == null)
_capcoll = new CaptureCollection(this);
return _capcoll;
}
}
/*
* Convert to a thread-safe object by precomputing cache contents
*/
///
/// Returns
/// a Group object equivalent to the one supplied that is safe to share between
/// multiple threads.
///
[HostProtection(Synchronization=true)]
static public Group Synchronized(Group inner) {
if (inner == null)
throw new ArgumentNullException("inner");
// force Captures to be computed.
CaptureCollection capcoll;
Capture dummy;
capcoll = inner.Captures;
if (inner._capcount > 0)
dummy = capcoll[0];
return inner;
}
}
}
// 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
- IndexOutOfRangeException.cs
- RuleInfoComparer.cs
- MapPathBasedVirtualPathProvider.cs
- StyleBamlTreeBuilder.cs
- DataGridRowClipboardEventArgs.cs
- BaseCollection.cs
- X509Certificate2.cs
- XmlWriter.cs
- PageStatePersister.cs
- XmlCharType.cs
- OleDbRowUpdatingEvent.cs
- SelectedCellsCollection.cs
- MulticastNotSupportedException.cs
- HttpCachePolicy.cs
- WindowsGraphics.cs
- ComponentFactoryHelpers.cs
- ThreadPoolTaskScheduler.cs
- EdmMember.cs
- DefaultAsyncDataDispatcher.cs
- EventHandlerService.cs
- GridProviderWrapper.cs
- VolatileEnlistmentMultiplexing.cs
- ControlBuilderAttribute.cs
- PersistenceTypeAttribute.cs
- IDReferencePropertyAttribute.cs
- ClientSettings.cs
- EventManager.cs
- DefaultProxySection.cs
- HttpListenerResponse.cs
- DataGridViewIntLinkedList.cs
- StringConverter.cs
- CodeSubDirectory.cs
- TreeNodeCollectionEditor.cs
- StreamWithDictionary.cs
- SoapSchemaExporter.cs
- AttachedPropertyDescriptor.cs
- MenuAdapter.cs
- SqlGenericUtil.cs
- dataobject.cs
- WeakReference.cs
- ProcessModuleCollection.cs
- XPathPatternBuilder.cs
- X509CertificateStore.cs
- ExtensionDataReader.cs
- EventLogPermissionEntryCollection.cs
- Path.cs
- OrderByLifter.cs
- SQLConvert.cs
- WebPartTransformer.cs
- ShaderEffect.cs
- Menu.cs
- ViewGenerator.cs
- WebConvert.cs
- DataPager.cs
- securitycriticaldataClass.cs
- AudioException.cs
- InlineUIContainer.cs
- SecurityTokenInclusionMode.cs
- CdpEqualityComparer.cs
- UrlAuthFailedErrorFormatter.cs
- Pen.cs
- CodeNamespaceImportCollection.cs
- Point4D.cs
- Point3DAnimation.cs
- DataGridViewImageColumn.cs
- InternalControlCollection.cs
- LicenseException.cs
- Regex.cs
- FunctionDetailsReader.cs
- OperationInfo.cs
- FtpWebResponse.cs
- DesignerLinkAdapter.cs
- ResourceDictionaryCollection.cs
- FileSystemInfo.cs
- CodeRemoveEventStatement.cs
- CodeDOMUtility.cs
- QueryResults.cs
- DbProviderFactory.cs
- RenderDataDrawingContext.cs
- TraceEventCache.cs
- SqlNodeAnnotations.cs
- XPathNodeHelper.cs
- DbProviderServices.cs
- ReferencedAssembly.cs
- InternalSafeNativeMethods.cs
- RootAction.cs
- ProcessHostMapPath.cs
- CTreeGenerator.cs
- TableSectionStyle.cs
- XmlSchemaCollection.cs
- Socket.cs
- DrawListViewSubItemEventArgs.cs
- Shared.cs
- Rect3D.cs
- PerformanceCounterPermission.cs
- XmlILCommand.cs
- ResourceIDHelper.cs
- CurrentTimeZone.cs
- COSERVERINFO.cs
- MemoryFailPoint.cs