System.Text.RegularExpressions.Group.Synchronized C# (CSharp) Method

Synchronized() public static method

Returns a Group object equivalent to the one supplied that is safe to share between multiple threads.
public static Synchronized ( Group inner ) : Group
inner Group
return Group
        public static Group Synchronized(Group inner)
        {
            if (inner == null)
                throw new ArgumentNullException(nameof(inner));

            // force Captures to be computed.

            CaptureCollection capcoll;
            Capture dummy;

            capcoll = inner.Captures;

            if (inner._capcount > 0)
                dummy = capcoll[0];

            return inner;
        }

Same methods

Group::Synchronized ( System inner ) : System.Text.RegularExpressions.Group

Usage Example

Example #1
0
        public static Match Synchronized(Match inner)
        {
            if (inner == null)
            {
                throw new ArgumentNullException();
            }
            int length = inner._matchcount.Length;

            for (int i = 0; i < length; i++)
            {
                Group group = inner.Groups[i];
                Group.Synchronized(group);
            }
            return(inner);
        }
All Usage Examples Of System.Text.RegularExpressions.Group::Synchronized