packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/UtilitiesLibrary/MeshLoader/XMeshLoader.XDataObject.cs
/// <summary>
/// Extracts a UUID declaration from a data object body if present.
/// </summary>
/// <param name="body">The current unparsed .x file body of the data object</param>
/// <returns>The UUID declaration if found, null otherwise.</returns>
/// <remarks>For template objects, be sure to parse the template restrictions
/// before trying to extract the UUID, so that any UUID references found in the
/// template restrictions don't get picked up by this method.</remarks>
Extracts a UUID declaration from a data object body if present.
Extracts a UUID declaration from a data object body if present .
private string ExtractUuid(ref string body)
            {
                string uuid;
                try
                {
                    uuid = ExtractByRegex(ref body, uuidDeclarationRegex,
                        uuidGroups => uuidGroups["uuid"].Value).SingleOrDefault();
                }
                catch (InvalidOperationException exc)
                {
                    throw new System.IO.InvalidDataException("Each data object may declare only one UUID", exc);
                }
                return uuid;
            }
private string ExtractUuid ( ref string body ) { string uuid ; try { uuid = ExtractByRegex ( ref body , uuidDeclarationRegex , uuidGroups => uuidGroups [ " " ] . Value ) . SingleOrDefault ( ) ; } catch ( InvalidOperationException exc ) { throw new System . IO . InvalidDataException ( " " , exc ) ; } return uuid ; }
Extracts a UUID declaration from a data object body if present.
Extracts a UUID declaration from a data object body if present .
The UUID declaration if found, null otherwise.
The UUID declaration if found null otherwise .
string
ref
body
The current unparsed .x file body of the data object
The current unparsed . x file body of the data object
remarks
For template objects, be sure to parse the template restrictions
before trying to extract the UUID, so that any UUID references found in the
template restrictions don't get picked up by this method.
For template objects be sure to parse the template restrictions before trying to extract the UUID so that any UUID references found in the template restrictions don ' t get picked up by this method .