packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/UtilitiesLibrary/MeshLoader/XMeshLoader.XDataObject.cs
/// <summary>
/// For a given restriction declaration, extracts the given templates
/// referenced within the declaration, or null if the declaration is of
/// an open restriction.
/// </summary>
/// <param name="groups">The match groups for the matched regex expression</param>
/// <returns>The enumeration of <see cref="IXTemplateObjects" /> represented within the single restriction declaration.</returns>
/// <remarks>The .x file format should not include multiple restriction declarations for
/// a given template object. However, it is theoretically legal to have multiple declarations
/// as long as they don't conflict (i.e. they either all are for an open restriction, or they
/// all list templates for a restricted restriction). This parser will attempt to resolve
/// such theoretically legal multiple declarations if present.</remarks>
For a given restriction declaration, extracts the given templates
referenced within the declaration, or null if the declaration is of
an open restriction.
For a given restriction declaration extracts the given templates referenced within the declaration or null if the declaration is of an open restriction .
private IEnumerable<IXTemplateObject> ExtractRestriction(GroupCollection groups)
            {
                if (groups["open"].Success)
                {
                    yield return null;
                }
                else
                {
                    foreach (Capture reference in groups["ref"].Captures)
                    {
                        Match restrictMatch = restrictionDeclarationRegex.Match(reference.Value);
                        XDataObject dataObject;
                        if (!restrictMatch.Groups["uuid"].Success ||
                            (dataObject = RetrieveObject(restrictMatch.Groups["uuid"].Value)) == null)
                        {
                            dataObject = RetrieveObject(restrictMatch.Groups["name"].Value);
                        }
                        if (dataObject != null)
                        {
                            yield return (XTemplateObject)dataObject;
                        }
                    }
                }
            }
private IEnumerable < IXTemplateObject > ExtractRestriction ( GroupCollection groups ) { if ( groups [ " " ] . Success ) { yield return null ; } else { foreach ( Capture reference in groups [ " " ] . Captures ) { Match restrictMatch = restrictionDeclarationRegex . Match ( reference . Value ) ; XDataObject dataObject ; if ( ! restrictMatch . Groups [ " " ] . Success || ( dataObject = RetrieveObject ( restrictMatch . Groups [ " " ] . Value ) ) == null ) { dataObject = RetrieveObject ( restrictMatch . Groups [ " " ] . Value ) ; } if ( dataObject != null ) { yield return ( XTemplateObject ) dataObject ; } } } }
For a given restriction declaration, extracts the given templates
referenced within the declaration, or null if the declaration is of
an open restriction.
For a given restriction declaration extracts the given templates referenced within the declaration or null if the declaration is of an open restriction .
The enumeration of  represented within the single restriction declaration.
The enumeration of represented within the single restriction declaration .
groups
GroupCollection
The match groups for the matched regex expression
The match groups for the matched regex expression
remarks
The .x file format should not include multiple restriction declarations for
a given template object. However, it is theoretically legal to have multiple declarations
as long as they don't conflict . This parser will attempt to resolve
such theoretically legal multiple declarations if present.
The . x file format should not include multiple restriction declarations for a given template object . However it is theoretically legal to have multiple declarations as long as they don ' t conflict . This parser will attempt to resolve such theoretically legal multiple declarations if present .